1 // RUN: %clang_cc1 -std=c++20 %s -fcxx-exceptions -fsyntax-only -Wexceptions -verify -fdeclspec
3 #include "Inputs/std-coroutine.h"
5 // expected-no-diagnostics
12 using promise_type
= promise
<T
>;
14 explicit task(promise_type
& p
) { throw 1; p
.return_val
= this; }
21 task
<T
> get_return_object() { return task
{*this}; }
23 std::suspend_never
initial_suspend() const noexcept
{ return {}; }
25 std::suspend_never
final_suspend() const noexcept
{ return {}; }
28 void return_value(U
&& val
) { return_val
->value
= static_cast<U
&&>(val
); }
30 void unhandled_exception() { throw 1; }
35 task
<int> a_ShouldNotDiag(const int a
, const int b
) {
42 task
<int> b_ShouldNotDiag(const int a
, const int b
) noexcept
{
49 const auto c_ShouldNotDiag
= [](const int a
, const int b
) -> task
<int> {
56 const auto d_ShouldNotDiag
= [](const int a
, const int b
) noexcept
-> task
<int> {