summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/coroutines.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-11-20 02:54:01 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-11-20 02:54:01 +0000
commit744b224bb5115f88ef301ccd6e850dff2ef567de (patch)
tree8cdfb515269079e1b884641515839455cf2c68b0 /clang/test/SemaCXX/coroutines.cpp
parent2dfc3b8be56dfc35b429cf8811e35f8b4e715446 (diff)
downloadbcm5719-llvm-744b224bb5115f88ef301ccd6e850dff2ef567de.tar.gz
bcm5719-llvm-744b224bb5115f88ef301ccd6e850dff2ef567de.zip
[coroutines] Per latest wording paper, co_* are no longer permitted in any
unevaluated operands. llvm-svn: 253641
Diffstat (limited to 'clang/test/SemaCXX/coroutines.cpp')
-rw-r--r--clang/test/SemaCXX/coroutines.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp
index c82302c3c07..6ca8d314f94 100644
--- a/clang/test/SemaCXX/coroutines.cpp
+++ b/clang/test/SemaCXX/coroutines.cpp
@@ -78,8 +78,17 @@ struct CtorDtor {
}
};
-constexpr void constexpr_coroutine() { // expected-error {{never produces a constant expression}}
- co_yield 0; // expected-error {{'co_yield' cannot be used in a constexpr function}} expected-note {{subexpression}}
+void unevaluated() {
+ decltype(co_await a); // expected-error {{cannot be used in an unevaluated context}}
+ sizeof(co_await a); // expected-error {{cannot be used in an unevaluated context}}
+ typeid(co_await a); // expected-error {{cannot be used in an unevaluated context}}
+ decltype(co_yield a); // expected-error {{cannot be used in an unevaluated context}}
+ sizeof(co_yield a); // expected-error {{cannot be used in an unevaluated context}}
+ typeid(co_yield a); // expected-error {{cannot be used in an unevaluated context}}
+}
+
+constexpr void constexpr_coroutine() {
+ co_yield 0; // expected-error {{'co_yield' cannot be used in a constexpr function}}
}
void varargs_coroutine(const char *, ...) {
OpenPOWER on IntegriCloud