diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-25 22:37:12 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-25 22:37:12 +0000 |
| commit | 7524de1da2a7e2fddd4e0db3d2da879d5377cfea (patch) | |
| tree | 5d42f01c66ed53f971d9eee5ae024ea70c2466c4 /clang/lib/AST/Expr.cpp | |
| parent | bb967cc98d6774ad6f4a423824f17ace8220e22d (diff) | |
| download | bcm5719-llvm-7524de1da2a7e2fddd4e0db3d2da879d5377cfea.tar.gz bcm5719-llvm-7524de1da2a7e2fddd4e0db3d2da879d5377cfea.zip | |
Change isNullPointerConstant to be strict; hopefully this won't cause
any issues now that we have our own tgmath.h.
llvm-svn: 70090
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 970d2951921..f9ca323a474 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -1374,12 +1374,8 @@ bool Expr::isNullPointerConstant(ASTContext &Ctx) const // If we have an integer constant expression, we need to *evaluate* it and // test for the value 0. - // FIXME: We should probably return false if we're compiling in strict mode - // and Diag is not null (this indicates that the value was foldable but not - // an ICE. - EvalResult Result; - return Evaluate(Result, Ctx) && !Result.HasSideEffects && - Result.Val.isInt() && Result.Val.getInt() == 0; + llvm::APSInt Result; + return isIntegerConstantExpr(Result, Ctx) && Result == 0; } /// isBitField - Return true if this expression is a bit-field. |

