diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-20 22:47:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-20 22:47:10 +0000 |
commit | ae3d147c91d1b413d87c77b282b7bb041fd904c9 (patch) | |
tree | 85f0504c35ee96a3c0dc1371093de0cd0b812e2f /clang/test/SemaCXX/coroutines.cpp | |
parent | 23da82c5eae5717256d96da2dc3631afc161b94d (diff) | |
download | bcm5719-llvm-ae3d147c91d1b413d87c77b282b7bb041fd904c9.tar.gz bcm5719-llvm-ae3d147c91d1b413d87c77b282b7bb041fd904c9.zip |
[coroutines] Support braced-init-list as operand of co_yield expression.
llvm-svn: 253726
Diffstat (limited to 'clang/test/SemaCXX/coroutines.cpp')
-rw-r--r-- | clang/test/SemaCXX/coroutines.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp index 9e15217031e..15536d83074 100644 --- a/clang/test/SemaCXX/coroutines.cpp +++ b/clang/test/SemaCXX/coroutines.cpp @@ -44,7 +44,7 @@ void undefined_promise() { // expected-error {{variable has incomplete type 'pro co_await a; } -struct yielded_thing { int a, b, c; const char *p; }; +struct yielded_thing { const char *p; short a, b; }; struct promise { awaitable yield_value(int); // expected-note {{candidate}} @@ -53,7 +53,10 @@ struct promise { void yield() { co_yield 0; - co_yield {1, 2, 3, "foo"}; // FIXME expected-error {{expected expression}} + co_yield {"foo", 1, 2}; + co_yield {1e100}; // expected-error {{cannot be narrowed}} expected-note {{explicit cast}} expected-warning {{changes value}} expected-warning {{braces around scalar}} + 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}} } |