Skip to content

Commit eeb51f2

Browse files
committed
Add test for unevaluate context
1 parent 85a4058 commit eeb51f2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/test/SemaCXX/coroutine-decltype.cpp renamed to clang/test/SemaCXX/coroutine-unevaluate.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ MyTask DoAnotherthing() {
3232
static_assert(__is_same(void, decltype(co_yield 0))); // expected-error {{'co_yield' cannot be used in an unevaluated context}}
3333
co_return;
3434
}
35+
36+
template<class>
37+
struct Task {};
38+
39+
void BracedInitListCXX26() {
40+
[]() -> Task<{ co_await 1 }> {}; // expected-error {{'co_await' cannot be used in an unevaluated context}}
41+
[]() -> Task<{ co_yield 1 }> {}; // expected-error {{'co_yield' cannot be used in an unevaluated context}}
42+
}

0 commit comments

Comments
 (0)