[clang] [Clang] Fix ICE when `initial_suspend()`'s `await_resume()` returns a non-trivially destructible type (PR #72935)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 17:09:29 PST 2023


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 2ca028ce7c6de5f1350440012355a65383b8729a 72fcc02a032e28517d87c8c0fe8279b9833bc9a9 -- clang/lib/CodeGen/CGCoroutine.cpp clang/lib/CodeGen/CGException.cpp clang/lib/CodeGen/CodeGenFunction.cpp clang/lib/CodeGen/CodeGenFunction.h
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp
index 4c171f36ff..e2f8140df1 100644
--- a/clang/lib/CodeGen/CGCoroutine.cpp
+++ b/clang/lib/CodeGen/CGCoroutine.cpp
@@ -696,8 +696,7 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
                          CurCoro.Data->ExceptionHandler);
 
       CompoundStmt *BodyStmt = S.getBody();
-      auto *TryStmt =
-          CXXTryStmt::Create(getContext(), Loc, BodyStmt, &Catch);
+      auto *TryStmt = CXXTryStmt::Create(getContext(), Loc, BodyStmt, &Catch);
 
       EnterCXXTryStmt(*TryStmt);
       EmitStmt(S.getInitSuspendStmt());
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 1a4bca20cc..c765419cd0 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -2928,7 +2928,7 @@ llvm::Value *CodeGenFunction::emitBoolVecConversion(llvm::Value *SrcVec,
 
 void CodeGenFunction::printEHStack() const {
   llvm::dbgs() << "EHStack: ";
-  for (const auto& scope : EHStack) {
+  for (const auto &scope : EHStack) {
     llvm::dbgs() << scope.getKind() << " ";
   }
   llvm::dbgs() << "\n";

``````````

</details>


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


More information about the cfe-commits mailing list