summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-01-12 20:32:25 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-01-12 20:32:25 +0000
commit04bdce64074c03446f9e31e4a99ff2d2730c89a9 (patch)
tree188b018c7b7930baf5101d51a920c805299ac939 /clang/lib/AST/ASTContext.cpp
parent7c743f2c7474105654716a4398394b48d84c1e7f (diff)
downloadbcm5719-llvm-04bdce64074c03446f9e31e4a99ff2d2730c89a9.tar.gz
bcm5719-llvm-04bdce64074c03446f9e31e4a99ff2d2730c89a9.zip
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. llvm-svn: 93252
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index e729b1b58d5..76ec852cb89 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud