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:
parent
3fe87a1eed
commit
a5df61a341
|
@ -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);
|
||||
|
|
|
@ -206,3 +206,14 @@ namespace BoolPtrToMember {
|
|||
return x.*member;
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR8507 {
|
||||
|
||||
struct S;
|
||||
void f(S* p, double S::*pm) {
|
||||
if (0 < p->*pm) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue