]> granicus.if.org Git - clang/commitdiff
Fix a crazy canonical-types bug because canonicalizing a
authorDouglas Gregor <dgregor@apple.com>
Fri, 30 Oct 2009 22:56:57 +0000 (22:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 30 Oct 2009 22:56:57 +0000 (22:56 +0000)
dependently-sized array type with a given expression might end up
returning a non-canonical type; see through that non-canonical type to
the underlying canonical type. Yes, I have a test case; no, I can't
reduce it to the point where it's worth checking in :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85633 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index f29f56e2789c103b3273f90824796e0a67b95efa..d445125459bc7d3d2bad75c38075f4cb623ebd12 100644 (file)
@@ -2305,7 +2305,7 @@ CanQualType ASTContext::getCanonicalType(QualType T) {
                                           DSAT->getSizeExpr()->Retain() : 0,
                                         DSAT->getSizeModifier(),
                                         DSAT->getIndexTypeCVRQualifiers(),
-                                        DSAT->getBracketsRange()));
+                        DSAT->getBracketsRange())->getCanonicalTypeInternal());
 
   VariableArrayType *VAT = cast<VariableArrayType>(AT);
   return CanQualType::CreateUnsafe(getVariableArrayType(NewEltTy,