================
@@ -2114,8 +2114,10 @@ static int getAsInt32(llvm::ConstantInt *C, llvm::Type
*I32Ty) {
Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) {
bool Ignore = TestAndClearIgnoreResultAssign();
(void)Ignore;
- assert (Ignore == false && "init list ignored");
unsigned NumInitElements = E->getNumInits();
+ assert(Ignore == false ||
+ (NumInitElements == 0 && E->getType()->isVoidType()) &&
+ "init list ignored");
----------------
brunodf-snps wrote:
This new assert formulation raises a warning in gcc -Wall:
https://godbolt.org/z/G8v1zqE4Y
And the grouping of the comment "init list ignored" to only the second
condition seems unintended or misleading. Could we revise this?
https://github.com/llvm/llvm-project/pull/147514
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits