]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Make a check more specific [PR109283].
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 29 May 2025 14:45:29 +0000 (15:45 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 29 May 2025 18:28:23 +0000 (19:28 +0100)
commit977fadd69776e2a8a6daca43e1c898bc4f87154d
treeb457038b550a3a02e590a2d075a9d927ee9131e7
parent5c6364b09a67de8d2237f65016ea1e3365a76e8d
c++, coroutines: Make a check more specific [PR109283].

The check was intended to assert that we had visited contained
ternary expressions with embedded co_awaits, but had been made
too general - and therefore was ICEing on code that was actually
OK.  Fixed by checking specifically that no co_awaits embedded.

PR c++/109283

gcc/cp/ChangeLog:

* coroutines.cc (find_any_await): Only save the statement
pointer if the caller passes a place for it.
(flatten_await_stmt): When checking that ternary expressions
have been handled, also check that they contain a co_await.

gcc/testsuite/ChangeLog:

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

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