[clang] [NFC] Fix commas on assertion from 147514 (PR #158635)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 15 06:26:50 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-codegen
Author: Erich Keane (erichkeane)
<details>
<summary>Changes</summary>
As brought up on the review for #<!-- -->147514, the original patch doesn't correctly parenthesize the expression in the assert. This fixes it.
---
Full diff: https://github.com/llvm/llvm-project/pull/158635.diff
1 Files Affected:
- (modified) clang/lib/CodeGen/CGExprScalar.cpp (+3-3)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/158635
More information about the cfe-commits
mailing list