aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-11-03 22:20:01 +0000
committerMike Stump <mrs@apple.com>2009-11-03 22:20:01 +0000
commitfbf6870f5931f7a4b6632b3594cde28b48cffb9d (patch)
treed996dc8ece3f3f86c297e33c33a8e8078d10db6d /lib/Sema/SemaExpr.cpp
parent7bf6e06cf88aa97a230972a3a136229efc46fd8b (diff)
We have to ensure we have the canonical type to do this. This is but
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
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index f71fb643f9..bdf1a7e010 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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();
}