]> 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>
Tue, 29 Jul 2025 15:05:31 +0000 (16:05 +0100)
commitb9b3471a9eb3f490b74b57236b4c122045dbcf56
tree9528c4de166069c29dbd12166f3ddad04dbec2a6
parentad8c618993682a02b758257e21647de28047c880
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>
(cherry picked from commit 0ae77a05c416c9f750cb87f1bef0800651168b7e)
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/coroutines/pr118903.C [new file with mode: 0644]