Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.

llvm-svn: 117850
This commit is contained in:
Anders Carlsson 2010-10-31 01:21:47 +00:00
parent 3fe87a1eed
commit a5df61a341
2 changed files with 15 additions and 0 deletions

View File

@ -1966,6 +1966,10 @@ bool FloatExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
return true;
}
// We can't evaluate pointer-to-member operations.
if (E->isPtrMemOp())
return false;
// FIXME: Diagnostics? I really don't understand how the warnings
// and errors are supposed to work.
APFloat RHS(0.0);

View File

@ -206,3 +206,14 @@ namespace BoolPtrToMember {
return x.*member;
}
}
namespace PR8507 {
struct S;
void f(S* p, double S::*pm) {
if (0 < p->*pm) {
}
}
}