summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-25 21:59:05 +0000
committerChris Lattner <sabre@nondot.org>2009-04-25 21:59:05 +0000
commitc71d08bc22ae12755afb4d65bc33852e4dba7355 (patch)
tree057f1041e843c726e8da5b13b7d96b7969bf894a /clang/lib/Sema/SemaExpr.cpp
parent4c73d7a9b804e12dbb2d41d63cfe96b2b9ec6cf2 (diff)
downloadbcm5719-llvm-c71d08bc22ae12755afb4d65bc33852e4dba7355.tar.gz
bcm5719-llvm-c71d08bc22ae12755afb4d65bc33852e4dba7355.zip
fix PR4073 by making designated initializer checking code use
VerifyIntegerConstantExpression instead of isIntegerConstantExpr. This makes it ext-warn but tolerate things that fold to a constant but that are not valid i-c-e's. There must be a bug in the i-c-e computation though, because it doesn't catch this case even with pedantic. This also switches the later code to use EvaluateAsInt which is simpler and handles everything that evaluate does. llvm-svn: 70081
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 474670dbb7a..e7d5ee18ff8 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4928,8 +4928,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
return isInvalid;
}
-bool Sema::VerifyIntegerConstantExpression(const Expr* E, llvm::APSInt *Result)
-{
+bool Sema::VerifyIntegerConstantExpression(const Expr *E, llvm::APSInt *Result){
Expr::EvalResult EvalResult;
if (!E->Evaluate(EvalResult, Context) || !EvalResult.Val.isInt() ||
OpenPOWER on IntegriCloud