diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-01-12 20:32:25 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-01-12 20:32:25 +0000 |
commit | 5535c38a2fcface6c13bc8bbeca66882de2fa227 (patch) | |
tree | b22ed8971f2daf7571379a65a3d21f5318b6e131 /lib/AST/ASTContext.cpp | |
parent | e9cde116a9beac8ad0acd99b9face9d07990cc73 (diff) |
Fix the CodeGen half of PR5911 by changing reference initialization to
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e729b1b58d..76ec852cb8 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2374,13 +2374,11 @@ CanQualType ASTContext::getCanonicalType(QualType T) { QualType ASTContext::getUnqualifiedArrayType(QualType T, Qualifiers &Quals) { - assert(T.isCanonical() && "Only operates on canonical types"); + Quals = T.getQualifiers(); if (!isa<ArrayType>(T)) { - Quals = T.getLocalQualifiers(); - return T.getLocalUnqualifiedType(); + return T.getUnqualifiedType(); } - assert(!T.hasQualifiers() && "canonical array type has qualifiers!"); const ArrayType *AT = cast<ArrayType>(T); QualType Elt = AT->getElementType(); QualType UnqualElt = getUnqualifiedArrayType(Elt, Quals); |