summaryrefslogtreecommitdiffstats
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-14 21:38:30 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-14 21:38:30 +0000
commit70488e201ccd94d4bb1ef0868cc13cca2b7d4ff6 (patch)
treeba334a4211ad43de9a739a2e5e3f236e3004b083 /lib/AST/ExprConstant.cpp
parenta91ac5bae3944e0eed9ef25294dfb2b8681b8159 (diff)
Pending clear answer from WG21 on whether core issue 903 is intended to apply to
C++11 or just C++17, restrict the set of null pointer constants in C++11 mode back to those which were considered null in C++98. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index c0fff5e478..787e722a7c 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -6435,12 +6435,17 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Value, ASTContext &Ctx,
return true;
}
+bool Expr::isCXX98IntegralConstantExpr(ASTContext &Ctx) const {
+ return CheckICE(this, Ctx).Val == 0;
+}
+
bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result,
SourceLocation *Loc) const {
// We support this checking in C++98 mode in order to diagnose compatibility
// issues.
assert(Ctx.getLangOptions().CPlusPlus);
+ // Build evaluation settings.
Expr::EvalStatus Status;
llvm::SmallVector<PartialDiagnosticAt, 8> Diags;
Status.Diag = &Diags;