summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/cxx1z-coroutines.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx1z-coroutines.cpp b/clang/test/Parser/cxx1z-coroutines.cpp
index 266337634e9..3e698404a60 100644
--- a/clang/test/Parser/cxx1z-coroutines.cpp
+++ b/clang/test/Parser/cxx1z-coroutines.cpp
@@ -19,3 +19,17 @@ U f(T t) {
else
co_return {t};
}
+
+struct Y {};
+struct X { Y operator co_await(); };
+struct Z {};
+Y operator co_await(Z);
+
+void f(X x, Z z) {
+ x.operator co_await();
+ operator co_await(z);
+}
+
+void operator co_await(); // expected-error {{must have at least one parameter}}
+void operator co_await(X, Y, Z); // expected-error {{must be a unary operator}}
+void operator co_await(int); // expected-error {{parameter of class or enumeration type}}
OpenPOWER on IntegriCloud