[clang] [Clang] Fix assertion failure (#189260) (PR #189305)

via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 29 21:45:57 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/CodeGen/CGExpr.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 737d4fd14..8190f82b7 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2782,9 +2782,9 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
         Vec = Builder.CreateBitCast(Vec, IRVecTy);
         // iN --> <N x i1>.
 
-        if(SrcVal->getType() != Builder.getInt1Ty())
-            SrcVal = Builder.CreateTrunc(SrcVal,Builder.getInt1Ty());
-        }
+        if (SrcVal->getType() != Builder.getInt1Ty())
+          SrcVal = Builder.CreateTrunc(SrcVal, Builder.getInt1Ty());
+      }
       }
 
       // Allow inserting `<1 x T>` into an `<N x T>`. It can happen with scalar

``````````

</details>


https://github.com/llvm/llvm-project/pull/189305


More information about the cfe-commits mailing list