diff options
Diffstat (limited to 'clang/test/SemaCXX/coroutines.cpp')
-rw-r--r-- | clang/test/SemaCXX/coroutines.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp index 3e18187295d..c82302c3c07 100644 --- a/clang/test/SemaCXX/coroutines.cpp +++ b/clang/test/SemaCXX/coroutines.cpp @@ -21,7 +21,12 @@ void no_specialization() { template<typename ...T> struct std::coroutine_traits<int, T...> {}; int no_promise_type() { - co_await a; // expected-error {{this function cannot be a coroutine: 'coroutine_traits<int>' has no member named 'promise_type'}} + co_await a; // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits<int>' has no member named 'promise_type'}} +} + +template<> struct std::coroutine_traits<double, double> { typedef int promise_type; }; +double bad_promise_type(double) { + co_await a; // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits<double, double>::promise_type' (aka 'int') is not a class}} } struct promise; // expected-note {{forward declaration}} |