summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2019-05-10 06:39:20 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2019-05-10 06:39:20 +0000
commit3e49615c158e33f8cff5439c8bd01f4b50e6b067 (patch)
tree68c2f79e140fea103def71a2d82f95c3aef99e84
parentd8066f9602863a39f208a52ca3be977c46a5d0f0 (diff)
downloadclang-3e49615c158e33f8cff5439c8bd01f4b50e6b067.tar.gz
Added an assert in `isConstantInitializer`: initializer lists must be in semantic form
Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61485 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/Expr.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index cf488850d3..90cc3f582b 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -2947,6 +2947,7 @@ bool Expr::isConstantInitializer(ASTContext &Ctx, bool IsForRef,
}
case InitListExprClass: {
const InitListExpr *ILE = cast<InitListExpr>(this);
+ assert(ILE->isSemanticForm() && "InitListExpr must be in semantic form");
if (ILE->getType()->isArrayType()) {
unsigned numInits = ILE->getNumInits();
for (unsigned i = 0; i < numInits; i++) {