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 | 09de1767990d4828bcaf0dd22033a5dddeecbe08 (patch) | |
tree | 57f3e3a745e6afbca01a63e79ca34cdfbba01054 /lib | |
parent | 3b5cccad43000e2c0bae52e6ec992a9fa1900266 (diff) |
Change isNullPointerConstant to be strict; hopefully this won't cause
any issues now that we have our own tgmath.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Expr.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 970d295192..f9ca323a47 100644 --- a/lib/AST/Expr.cpp +++ b/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. |