]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Improve check for throwing final await [PR104051].
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 18 Apr 2022 15:23:30 +0000 (16:23 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 28 Apr 2022 12:55:09 +0000 (13:55 +0100)
commit7b96274a340bc0e9bcaef9baff3a44ec2f12c3df
tree3c128f69639489b6f60785c8bb5b3a42b6042bc2
parent6cae3bb65c873a2191613f7888fe949553a21f9e
c++, coroutines: Improve check for throwing final await [PR104051].

We check that the final_suspend () method returns a sane type (i.e. a class
or structure) but, unfortunately, that check has to be later than the one
for a throwing case.  If the use returns some nonsensical type from the
method, we need to handle that in the checking for noexcept.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/104051

gcc/cp/ChangeLog:

* coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
non-target expression inputs.

gcc/testsuite/ChangeLog:

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