// { dg-additional-options "-O -Wunused-function" } #if __has_include () #include using namespace std; #elif defined (__clang__) && __has_include () #include namespace std { using namespace experimental; } #endif struct dummy { struct promise_type { dummy get_return_object() const noexcept { return {}; } std::suspend_never initial_suspend() const noexcept { return {}; } std::suspend_never final_suspend() const noexcept { return {}; } void return_void() const noexcept {} void unhandled_exception() const noexcept {} }; }; // This checks that the attribute is passed on to the outlined coroutine // functions (so that there should be no diagnostic). [[maybe_unused]] static dummy foo() { co_return; }