summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-11-30 23:41:18 +0000
committerFangrui Song <maskray@google.com>2018-11-30 23:41:18 +0000
commit407659ab0a1048027b3419b163c245036469ec35 (patch)
tree52e6ecfa03743811c8c88293f77a520618561b15 /clang/lib/Sema/SemaDecl.cpp
parentcada498038e320b175130210c7bf2386e3e50a91 (diff)
downloadbcm5719-llvm-407659ab0a1048027b3419b163c245036469ec35.tar.gz
bcm5719-llvm-407659ab0a1048027b3419b163c245036469ec35.zip
Revert "Revert r347417 "Re-Reinstate 347294 with a fix for the failures.""
It seems the two failing tests can be simply fixed after r348037 Fix 3 cases in Analysis/builtin-functions.cpp Delete the bad CodeGen/builtin-constant-p.c for now llvm-svn: 348053
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index cf626e01012..becbb1f186d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5575,11 +5575,13 @@ static QualType TryToFixInvalidVariablyModifiedType(QualType T,
if (VLATy->getElementType()->isVariablyModifiedType())
return QualType();
- llvm::APSInt Res;
+ Expr::EvalResult Result;
if (!VLATy->getSizeExpr() ||
- !VLATy->getSizeExpr()->EvaluateAsInt(Res, Context))
+ !VLATy->getSizeExpr()->EvaluateAsInt(Result, Context))
return QualType();
+ llvm::APSInt Res = Result.Val.getInt();
+
// Check whether the array size is negative.
if (Res.isSigned() && Res.isNegative()) {
SizeIsNegative = true;
OpenPOWER on IntegriCloud