diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-04 07:31:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-04 07:31:14 +0000 |
commit | c63a1f276f7b324fd9a4be82098b1c8f7bf30733 (patch) | |
tree | d20bfdf2549bd5906f9e6347e7576871205f6453 /lib/AST/Expr.cpp | |
parent | 0998c65aeab7ad319bec8a93931196c170ed74d8 (diff) |
Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).
Fixing this greatly simplifies getArrayDecayedType, which is a good sign.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 60b762f66d..21f2b07d13 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -466,14 +466,17 @@ Expr::isModifiableLvalueResult Expr::isModifiableLvalue(ASTContext &Ctx) const { case LV_DuplicateVectorComponents: return MLV_DuplicateVectorComponents; case LV_InvalidExpression: return MLV_InvalidExpression; } - if (TR.isConstQualified()) + + QualType CT = Ctx.getCanonicalType(getType()); + + if (CT.isConstQualified()) return MLV_ConstQualified; - if (TR->isArrayType()) + if (CT->isArrayType()) return MLV_ArrayType; - if (TR->isIncompleteType()) + if (CT->isIncompleteType()) return MLV_IncompleteType; - if (const RecordType *r = TR->getAsRecordType()) { + if (const RecordType *r = CT->getAsRecordType()) { if (r->hasConstFields()) return MLV_ConstQualified; } |