1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 \
2 // RUN: -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \
3 // RUN: -fblocks -Wno-unreachable-code -Wno-unused-value
5 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 \
6 // RUN: -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \
7 // RUN: -fblocks -Wno-unreachable-code -Wno-unused-value \
8 // RUN: -DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception
10 #if __has_feature(cxx_exceptions)
11 #error This test requires exceptions be disabled
14 #include "Inputs/std-coroutine.h"
16 using std::suspend_always
;
17 using std::suspend_never
;
19 #ifndef DISABLE_WARNING
20 struct promise_void
{ // expected-note {{defined here}}
24 void get_return_object();
25 suspend_always
initial_suspend();
26 suspend_always
final_suspend() noexcept
;
30 template <typename
... T
>
31 struct std::coroutine_traits
<void, T
...> { using promise_type
= promise_void
; };
33 #ifndef DISABLE_WARNING
34 void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}}
38 void test0() { // expected-no-diagnostics