diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-10-01 20:36:17 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-10-01 20:36:17 +0000 |
commit | cdd1da209dfc542b69ab7db539688c2ed7bc00d7 (patch) | |
tree | 82cfec16c05d0eb9cb7c2d31a535ecf8a936494f /clang/lib/AST/ExprConstant.cpp | |
parent | 1620ebd98f6c3cafebcf87ca06ec1d084cab51d8 (diff) | |
download | bcm5719-llvm-cdd1da209dfc542b69ab7db539688c2ed7bc00d7.tar.gz bcm5719-llvm-cdd1da209dfc542b69ab7db539688c2ed7bc00d7.zip |
Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.
llvm-svn: 164968
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index c4fd70a8c8b..05912fc1c5a 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -6196,11 +6196,9 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) { return false; Result = Info.CurrentCall->Temporaries[E]; } else if (E->getType()->isVoidType()) { - if (Info.getLangOpts().CPlusPlus0x) + if (!Info.getLangOpts().CPlusPlus0x) Info.CCEDiag(E, diag::note_constexpr_nonliteral) << E->getType(); - else - Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr); if (!EvaluateVoid(E, Info)) return false; } else if (Info.getLangOpts().CPlusPlus0x) { |