diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-09 22:58:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-09 22:58:01 +0000 |
commit | f48fdb0937e67f691393f9ffdf75653e5128ea13 (patch) | |
tree | 33b0dc89859845c093891fc0609366e429ebc3d9 /lib/Sema/SemaExpr.cpp | |
parent | 0373fcc3e5b205cc26656c70d7dff737b0e08345 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index aeae6666dc..f7e67cdf3e 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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); } |