diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-18 08:46:16 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-18 08:46:16 +0000 |
commit | f515b2268f829adfbfdb751f54d102b53ed0285c (patch) | |
tree | 625ef2f816cf73dfef5cace274c17fc1f339fb35 | |
parent | 240592ca490ca3084fef0acfab39f12218ce8168 (diff) |
Disable questionable code for handling isNullPointerConstant on value dependent
expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82217 91177308-0d34-0410-b5e6-96231b3b80d8
-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. |