aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-13 20:58:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-13 20:58:32 +0000
commit4b1f684416980ef6f1a7cb9e6af9c4fa4a164617 (patch)
tree9b000e173a5486c0d3660603af9435da65deacc8 /lib/AST/ExprConstant.cpp
parentcf3a6c448ccddcefd84cc2be5f8c8927e2e5468d (diff)
Allow vectors to be constructed from constexpr function arguments in
constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 4531a46448..7d65cf585b 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -3743,7 +3743,7 @@ VectorExprEvaluator::VisitInitListExpr(const InitListExpr *E) {
llvm::APSInt sInt(32);
if (CountInits < NumInits) {
if (!EvaluateInteger(E->getInit(CountInits), sInt, Info))
- return Error(E);
+ return false;
} else // trailing integer zero.
sInt = Info.Ctx.MakeIntValue(0, EltTy);
Elements.push_back(APValue(sInt));
@@ -3752,7 +3752,7 @@ VectorExprEvaluator::VisitInitListExpr(const InitListExpr *E) {
llvm::APFloat f(0.0);
if (CountInits < NumInits) {
if (!EvaluateFloat(E->getInit(CountInits), f, Info))
- return Error(E);
+ return false;
} else // trailing float zero.
f = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(EltTy));
Elements.push_back(APValue(f));