diff options
-rw-r--r-- | lib/AST/Expr.cpp | 4 | ||||
-rw-r--r-- | test/SemaCXX/value-dependent-exprs.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index d7565c7bbe..60458b4fb6 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1627,8 +1627,8 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, /// cast to void*. bool Expr::isNullPointerConstant(ASTContext &Ctx) const { // Ignore value dependent expressions. - if (isValueDependent()) - return true; + assert(!isValueDependent() && "Unexpect value dependent expression!"); + // Strip off a cast to void*, if it exists. Except in C++. if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) { if (!Ctx.getLangOptions().CPlusPlus) { diff --git a/test/SemaCXX/value-dependent-exprs.cpp b/test/SemaCXX/value-dependent-exprs.cpp index 603da9b38e..c70f895d2b 100644 --- a/test/SemaCXX/value-dependent-exprs.cpp +++ b/test/SemaCXX/value-dependent-exprs.cpp @@ -14,10 +14,13 @@ class C0 { int b[I]; }; + // FIXME: I'm unclear where the right place to handle this is. +#if 0 void f0(int *p) { if (p == I) { } } +#endif #if 0 // FIXME: Not sure whether we care about these. |