From f57d8cb13121b1ecc171a7dc4393ed4cbebb835b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 9 Dec 2011 22:58:01 +0000 Subject: C++11 constant expressions: Don't use CheckICE in C++11; instead, determine whether an expression is a (core) constant expression as a side-effect of evaluation. This takes us from accepting far too few expressions as ICEs to accepting slightly too many -- fixes for the remaining cases are coming next. The diagnostics produced when an expression is found to be non-constant are currently quite poor (with generic wording but reasonable source locations), and will be improved in subsequent commits. llvm-svn: 146289 --- clang/lib/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index aeae6666dc9..f7e67cdf3e0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9206,7 +9206,7 @@ bool Sema::VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result){ if (EvalResult.Diag) { // We only show the note if it's not the usual "invalid subexpression" // or if it's actually in a subexpression. - if (EvalResult.Diag != diag::note_invalid_subexpr_in_ice || + if (EvalResult.Diag != diag::note_invalid_subexpr_in_const_expr || E->IgnoreParens() != EvalResult.DiagExpr->IgnoreParens()) Diag(EvalResult.DiagLoc, EvalResult.Diag); } -- cgit v1.2.3