]> granicus.if.org Git - clang/commitdiff
We have to ensure we have the canonical type to do this. This is but
authorMike Stump <mrs@apple.com>
Tue, 3 Nov 2009 22:20:01 +0000 (22:20 +0000)
committerMike Stump <mrs@apple.com>
Tue, 3 Nov 2009 22:20:01 +0000 (22:20 +0000)
one instance of a large problem.  assert for non-canoical types would
help track down these things.

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

lib/Sema/SemaExpr.cpp

index f71fb643f9c02bbe92e84dc575f620a4c6bf8d91..bdf1a7e010bd88130bf7ccba083be706b3ce59f4 100644 (file)
@@ -1098,7 +1098,8 @@ Sema::BuildDeclarationNameExpr(SourceLocation Loc, NamedDecl *D,
     //    - a constant with integral or enumeration type and is
     //      initialized with an expression that is value-dependent
     else if (const VarDecl *Dcl = dyn_cast<VarDecl>(VD)) {
-      if (Dcl->getType().getCVRQualifiers() == Qualifiers::Const &&
+      if (Context.getCanonicalType(Dcl->getType()).getCVRQualifiers()
+          == Qualifiers::Const &&
           Dcl->getInit()) {
         ValueDependent = Dcl->getInit()->isValueDependent();
       }