[all-commits] [llvm/llvm-project] e12a55: [Clang][CodeGen][Coroutines] Make coroutine startu...

Yexuan Xiao via All-commits all-commits at lists.llvm.org
Tue Jun 9 01:02:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e12a55706f77052a20cf315d0d8c83a910b360fb
      https://github.com/llvm/llvm-project/commit/e12a55706f77052a20cf315d0d8c83a910b360fb
  Author: Yexuan Xiao <bizwen at nykz.org>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/CGCoroutine.cpp
    A clang/test/CodeGenCoroutines/coro-cwg2935.cpp

  Log Message:
  -----------
  [Clang][CodeGen][Coroutines] Make coroutine startup exception-safe (C… (#202279)

…WG2935)

This patch attempts to implement the solution I proposed for [CWG2935
(Github)](https://github.com/cplusplus/CWG/issues/575), aligning Clang's
behavior with GCC and MSVC instead of leaving it undefined. When
`initial_suspend` (as well as `ready` and `suspend`) throws an
exception, Clang fails to destroy the task even though the task has
already been initialized (see https://godbolt.org/z/E4Y4bEn54).

This patch updates CGCoroutine.cpp to clean up the coroutine return
value after an exception is thrown when it is constructed in place,
addressing CWG2935.

I would like to hear more opinions on the solution and seek help to fix
Clang.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list