]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/coroutines: fix actor cases not being added to the current switch [PR109867]
authorArsen Arsenović <arsen@aarsen.me>
Wed, 24 Jul 2024 18:43:01 +0000 (20:43 +0200)
committerArsen Arsenović <arsen@gcc.gnu.org>
Tue, 27 Aug 2024 21:11:43 +0000 (23:11 +0200)
commitff0cba200af72f2514ebc987a99027f314d4cc99
treed7be4060a8ff2a14db316c94ee3d0597d9bd2fde
parenta83e519ab2d4e7df2756411cd9d21c6f1b583429
c++/coroutines: fix actor cases not being added to the current switch [PR109867]

Previously, we were building and inserting case_labels manually, which
led to them not being added into the currently running switch via
c_add_case_label.  This led to false diagnostics that the user could not
act on.

PR c++/109867

gcc/cp/ChangeLog:

* coroutines.cc (expand_one_await_expression): Replace uses of
build_case_label with finish_case_label.
(build_actor_fn): Ditto.
(create_anon_label_with_ctx): Remove now-unused function.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/torture/pr109867.C: New test.

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