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
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 2aefae6..94d2299 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -180,6 +180,16 @@
{ 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