diff options
author | Bill Wendling <isanbard@gmail.com> | 2018-11-09 00:41:36 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2018-11-09 00:41:36 +0000 |
commit | 8003edc9aa0160c777252b6ed8e96fc35f039bd4 (patch) | |
tree | d6a07c2e0b407f57baf6be744b81ef140079eb7d /clang/lib/StaticAnalyzer/Core/Environment.cpp | |
parent | 009cc9b7cadc81b50127f14ccdb8ff10fccc1f00 (diff) | |
download | bcm5719-llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.tar.gz bcm5719-llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.zip |
Compound literals, enums, et al require const expr
Summary:
Compound literals, enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
expressions in a ConstantExpr so that we can easily check for this later
on.
Reviewers: rsmith, shafik
Reviewed By: rsmith
Subscribers: cfe-commits, jyknight, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D53921
llvm-svn: 346455
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/Environment.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp b/clang/lib/StaticAnalyzer/Core/Environment.cpp index da99dbc7acb..43bbcd7c6af 100644 --- a/clang/lib/StaticAnalyzer/Core/Environment.cpp +++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp @@ -92,6 +92,7 @@ SVal Environment::getSVal(const EnvironmentEntry &Entry, case Stmt::ExprWithCleanupsClass: case Stmt::GenericSelectionExprClass: case Stmt::OpaqueValueExprClass: + case Stmt::ConstantExprClass: case Stmt::ParenExprClass: case Stmt::SubstNonTypeTemplateParmExprClass: llvm_unreachable("Should have been handled by ignoreTransparentExprs"); |