[clang] [NFC] Fix commas on assertion from 147514 (PR #158635)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 15 06:26:12 PDT 2025


https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/158635

As brought up on the review for #147514, the original patch doesn't correctly parenthesize the expression in the assert.  This fixes it.

>From fb0069a186a7f5d368413c53215897c5529e17ce Mon Sep 17 00:00:00 2001
From: erichkeane <ekeane at nvidia.com>
Date: Mon, 15 Sep 2025 06:19:07 -0700
Subject: [PATCH] [NFC] Fix commas on assertion from 147514

As brought up on the review for #147514, the original patch doesn't
correctly parenthesize the expression in the assert.  This fixes it.
---
 clang/lib/CodeGen/CGExprScalar.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index ce483c5cc4e45..4fa25c5d66669 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -2142,9 +2142,9 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) {
   bool Ignore = TestAndClearIgnoreResultAssign();
   (void)Ignore;
   unsigned NumInitElements = E->getNumInits();
-  assert(Ignore == false ||
-         (NumInitElements == 0 && E->getType()->isVoidType()) &&
-             "init list ignored");
+  assert((Ignore == false ||
+          (NumInitElements == 0 && E->getType()->isVoidType())) &&
+         "init list ignored");
 
   // HLSL initialization lists in the AST are an expansion which can contain
   // side-effecting expressions wrapped in opaque value expressions. To properly



More information about the cfe-commits mailing list