forked from OSchip/llvm-project
Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.
llvm-svn: 83267
This commit is contained in:
parent
c46bf276e1
commit
de55f647ff
|
@ -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
|
||||
|
|
|
@ -95,3 +95,8 @@ struct A {
|
|||
void f(A* a) {
|
||||
int b = a->b();
|
||||
}
|
||||
|
||||
// PR5122
|
||||
void *foo = 0;
|
||||
void * const & kFoo = foo;
|
||||
|
||||
|
|
Loading…
Reference in New Issue