]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Emit an error for attempted constexpr co_await [PR118903].
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 30 May 2025 19:09:40 +0000 (20:09 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Mon, 2 Jun 2025 18:30:05 +0000 (19:30 +0100)
commit0ae77a05c416c9f750cb87f1bef0800651168b7e
tree4232b83aa39fa433d8a19002e4b719995918d740
parent09cac2a833689f2535d6c2c88a67b2169df4e4d7
c++: Emit an error for attempted constexpr co_await [PR118903].

We checked that the coroutine expressions were not suitable for
constexpr, but did not emit and error when needed.

PR c++/118903

gcc/cp/ChangeLog:

* constexpr.cc (potential_constant_expression_1): Emit
an error when co_await et. al. are used in constexpr
contexts.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr118903.C: New test.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/coroutines/pr118903.C [new file with mode: 0644]