summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/coroutines.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-11-22 02:57:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-11-22 02:57:17 +0000
commitd7bed4d6608fe4ce783676f38aabbeaf1a080763 (patch)
treeb6d2d96e380173946961a0925c3eda9300c506a8 /clang/test/SemaCXX/coroutines.cpp
parent7b948a77928bc06e9a1099fdc001e9c5d946d392 (diff)
downloadbcm5719-llvm-d7bed4d6608fe4ce783676f38aabbeaf1a080763.tar.gz
bcm5719-llvm-d7bed4d6608fe4ce783676f38aabbeaf1a080763.zip
[coroutines] Factor out co_await representation into common base class for co_await and co_yield, and use it to hold await_* calls.
llvm-svn: 253811
Diffstat (limited to 'clang/test/SemaCXX/coroutines.cpp')
-rw-r--r--clang/test/SemaCXX/coroutines.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp
index 53226f7af21..d5968fcd303 100644
--- a/clang/test/SemaCXX/coroutines.cpp
+++ b/clang/test/SemaCXX/coroutines.cpp
@@ -46,9 +46,12 @@ void undefined_promise() { // expected-error {{variable has incomplete type 'pro
struct yielded_thing { const char *p; short a, b; };
+struct not_awaitable {};
+
struct promise {
awaitable yield_value(int); // expected-note {{candidate}}
awaitable yield_value(yielded_thing); // expected-note {{candidate}}
+ not_awaitable yield_value(void()); // expected-note {{candidate}}
};
void yield() {
@@ -58,6 +61,8 @@ void yield() {
co_yield {"foo", __LONG_LONG_MAX__}; // expected-error {{cannot be narrowed}} expected-note {{explicit cast}} expected-warning {{changes value}}
co_yield {"foo"};
co_yield "foo"; // expected-error {{no matching}}
+ co_yield 1.0;
+ co_yield yield; // expected-error {{no member named 'await_ready' in 'not_awaitable'}}
}
void mixed_yield() {
OpenPOWER on IntegriCloud