r360406 - Added an assert in `isConstantInitializer`: initializer lists must be in semantic form
Dmitri Gribenko via cfe-commits
cfe-commits at lists.llvm.org
Thu May 9 23:39:21 PDT 2019
Author: gribozavr
Date: Thu May 9 23:39:20 2019
New Revision: 360406
URL: http://llvm.org/viewvc/llvm-project?rev=360406&view=rev
Log:
Added an assert in `isConstantInitializer`: initializer lists must be in semantic form
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61485
Modified:
cfe/trunk/lib/AST/Expr.cpp
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=360406&r1=360405&r2=360406&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu May 9 23:39:20 2019
@@ -2947,6 +2947,7 @@ bool Expr::isConstantInitializer(ASTCont
}
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++) {
More information about the cfe-commits
mailing list