]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++,coroutines: Handle await expressions in assume attributes.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 9 Jun 2025 10:26:01 +0000 (11:26 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 17 Jun 2025 15:07:09 +0000 (18:07 +0300)
commit4ff09eb3422c525d514c869c7e0366fd5b40b561
treedecab174b106d8caf4f850b1e08be258d3cece94
parenta22ed5658797cc9ca4421e69db5d6259389a4156
c++,coroutines: Handle await expressions in assume attributes.

Here we have an expression that is not evaluated but is still seen
as potentially-evaluated.  We handle this by determining if the
operand has side-effects, producing a warning that the assume has
been ignored and eliding it.

gcc/cp/ChangeLog:

* coroutines.cc (analyze_expression_awaits): Elide assume
attributes containing await expressions, since these have
side effects.  Emit a diagnostic that this has been done.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/assume.C: New test.
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/assume.C [new file with mode: 0644]