]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/coro: prevent ICV_STATEMENT diagnostics in temp promotion [PR116502]
authorArsen Arsenović <arsen@aarsen.me>
Wed, 28 Aug 2024 19:59:18 +0000 (21:59 +0200)
committerArsen Arsenović <arsen@gcc.gnu.org>
Fri, 27 Sep 2024 11:37:37 +0000 (13:37 +0200)
commit05e4f07cad1eacf869c10622cae2a9cdee3b6a7a
tree14d2c582a21ea135e1b6670c9de802cf5df4a882
parent037c97e114341143af35f4df3ff49e12afacf105
c++/coro: prevent ICV_STATEMENT diagnostics in temp promotion [PR116502]

If such a diagnostic is necessary, it has already been emitted,
otherwise, it is not correct and emitting it here is inactionable by the
user, and bogus.

PR c++/116502

gcc/cp/ChangeLog:

* coroutines.cc (maybe_promote_temps): Convert temporary
initializers to void without complaining.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/maybe-unused-1.C: New test.
* g++.dg/coroutines/pr116502.C: New test.
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/maybe-unused-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/coroutines/pr116502.C [new file with mode: 0644]