| // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -std=c++20 -fsyntax-only -verify -Wunreachable-code |
| #include "Inputs/std-coroutine.h" |
| extern void abort(void) __attribute__((__noreturn__)); |
| std::suspend_always initial_suspend(); |
| std::suspend_always final_suspend() noexcept; |
| std::suspend_always yield_value(int) { return {}; } |
| task get_return_object(); |
| void unhandled_exception(); |
| void await_suspend(auto); |
| auto await_transform(const int& x) { return Awaiter{}; } |
| 1; // expected-warning {{code will never be executed}} |
| 1; // expected-warning {{code will never be executed}} |
| 1; // expected-warning {{code will never be executed}} |
| // coroutine statements are not considered unreachable. |
| // coroutine statements are not considered unreachable. |
| 1 + 1; // expected-warning {{code will never be executed}} |
| // This warning is emitted on the declaration itself, rather the coroutine substmt. |
| int x = co_await 1; // expected-warning {{code will never be executed}} |