[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

Adrian Vogelsgesang via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 15:18:55 PDT 2024


================
@@ -0,0 +1,84 @@
+// This file tests the coro_structured_concurrency attribute semantics. 
+// RUN: %clang_cc1 -std=c++20 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+#include "Inputs/coroutine.h"
+#include "Inputs/utility.h"
+
+template <typename T>
+struct [[clang::coro_structured_concurrency]] Task {
----------------
vogelsgesang wrote:

Afaict, this particular `Task` can also be annotated using `coro_only_destroy_when_complete`?

I guess many libraries would want to use both `coro_structured_concurrency` / `coro_inplace_task` and `coro_only_destroy_when_complete`. Do those optimizations interact well with each other? Does it make sense to add a test case which tests both attributes together?

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


More information about the cfe-commits mailing list