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 | 01cad02220180b9646525295f502c00c64a172d0 (patch) | |
tree | 7f67b1431b7c566eb0b5d658835b8ec9338041b6 /lib/AST/ExprConstant.cpp | |
parent | c4a839101e883261d038a1d5ea718dd46abd1d2d (diff) |
Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index c4fd70a8c8..05912fc1c5 100644 --- a/lib/AST/ExprConstant.cpp +++ b/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) { |