Skip to content

Commit

Permalink
Added an assert in isConstantInitializer: initializer lists must be…
Browse files Browse the repository at this point in the history
… in semantic form

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61485

llvm-svn: 360406
  • Loading branch information
gribozavr authored and MrSidims committed May 17, 2019
1 parent 6a6bab2 commit b2c402c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clang/lib/AST/Expr.cpp
Expand Up @@ -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++) {
Expand Down

0 comments on commit b2c402c

Please sign in to comment.