summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/coroutines.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-09-29 21:47:39 +0000
committerEric Fiselier <eric@efcs.ca>2016-09-29 21:47:39 +0000
commita546528d7b929a1494141ebd73da5c081c45b15d (patch)
treea9da92ab23e4511aa221e5a9d408d6256520e808 /clang/test/SemaCXX/coroutines.cpp
parentfa47ff3349b3f68c02c04c624cf7da4cd32e0b51 (diff)
downloadbcm5719-llvm-a546528d7b929a1494141ebd73da5c081c45b15d.tar.gz
bcm5719-llvm-a546528d7b929a1494141ebd73da5c081c45b15d.zip
[Coroutines] Fix assertion about uncorrected typos in co_await/co_yield/co_return expressions
llvm-svn: 282792
Diffstat (limited to 'clang/test/SemaCXX/coroutines.cpp')
-rw-r--r--clang/test/SemaCXX/coroutines.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp
index e82cb62f12d..d375e9eddb3 100644
--- a/clang/test/SemaCXX/coroutines.cpp
+++ b/clang/test/SemaCXX/coroutines.cpp
@@ -1,5 +1,22 @@
// RUN: %clang_cc1 -std=c++14 -fcoroutines -verify %s
+void no_coroutine_traits_bad_arg_await() {
+ co_await a; // expected-error {{include <coroutine>}}
+ // expected-error@-1 {{use of undeclared identifier 'a'}}
+}
+
+void no_coroutine_traits_bad_arg_yield() {
+ co_yield a; // expected-error {{include <coroutine>}}
+ // expected-error@-1 {{use of undeclared identifier 'a'}}
+}
+
+
+void no_coroutine_traits_bad_arg_return() {
+ co_return a; // expected-error {{include <coroutine>}}
+ // expected-error@-1 {{use of undeclared identifier 'a'}}
+}
+
+
struct awaitable {
bool await_ready();
void await_suspend(); // FIXME: coroutine_handle
OpenPOWER on IntegriCloud