[clang] Surface error for plain return statement in coroutine earlier (PR #100985)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 02:21:37 PDT 2024


================
@@ -291,6 +294,38 @@ void mixed_coreturn_template2(bool b, T) {
     return; // expected-error {{not allowed in coroutine}}
 }
 
+struct promise_handle;
+
+struct Handle : std::coroutine_handle<promise_handle> { // expected-note 2{{candidate constructor (the implicit copy constructor) not viable}}
----------------
ilya-biryukov wrote:

NIT: for brevity we could use a shorter substring (same below)
```suggestion
struct Handle : std::coroutine_handle<promise_handle> { // expected-note 2{{not viable}}
```

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


More information about the cfe-commits mailing list