diff options
author | Anders Carlsson <andersca@mac.com> | 2009-10-03 16:30:22 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-10-03 16:30:22 +0000 |
commit | 26bc220377705292a0519a71d3ea3aef68fcfec6 (patch) | |
tree | 583b838e13dc8dc9a30afd977b7573eb38c4374a /lib/AST/ExprConstant.cpp | |
parent | a024d17048cd7fb71bfaee3876993ef2c27057be (diff) |
Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 2aefae6fd7..94d22998eb 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -180,6 +180,16 @@ public: { return Visit(E->getSubExpr()); } APValue VisitChooseExpr(const ChooseExpr *E) { return Visit(E->getChosenSubExpr(Info.Ctx)); } + + APValue VisitCastExpr(CastExpr *E) { + switch (E->getCastKind()) { + default: + return APValue(); + + case CastExpr::CK_NoOp: + return Visit(E->getSubExpr()); + } + } // FIXME: Missing: __real__, __imag__ }; } // end anonymous namespace |