Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.

llvm-svn: 83267
This commit is contained in:
Anders Carlsson 2009-10-03 16:30:22 +00:00
parent c46bf276e1
commit de55f647ff
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -95,3 +95,8 @@ struct A {
void f(A* a) {
int b = a->b();
}
// PR5122
void *foo = 0;
void * const & kFoo = foo;