]> granicus.if.org Git - clang/commitdiff
if an arraytype is canonical, then its element is guaranteed to be canonical.
authorZhongxing Xu <xuzhongxing@gmail.com>
Tue, 5 Jan 2010 08:15:06 +0000 (08:15 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Tue, 5 Jan 2010 08:15:06 +0000 (08:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92715 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 74e74e7aba0bd186412fb0d162678240ee81e329..ad10aa38edb2e2d4aad618c9a4f813d18ec63717 100644 (file)
@@ -2383,7 +2383,8 @@ QualType ASTContext::getUnqualifiedArrayType(QualType T,
   assert(!T.hasQualifiers() && "canonical array type has qualifiers!");
   const ArrayType *AT = cast<ArrayType>(T);
   QualType Elt = AT->getElementType();
-  QualType UnqualElt = getUnqualifiedArrayType(getCanonicalType(Elt), Quals);
+  assert(Elt.isCanonical());
+  QualType UnqualElt = getUnqualifiedArrayType(Elt, Quals);
   if (Elt == UnqualElt)
     return T;