c++: computed goto from catch block [PR81438]
commit2488771b6dc6b05bfdc68dbd6b7bbe0489c8dad0
authorJason Merrill <jason@redhat.com>
Thu, 21 Dec 2023 02:34:49 +0000 (20 21:34 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 22 Dec 2023 03:18:00 +0000 (21 22:18 -0500)
treefe6e93dc97a5ff9e5586ee1db567bb1d4723ffcd
parent5cb79aa2bdb2f6713b595b43637296a2cbdd6521
c++: computed goto from catch block [PR81438]

As with 37722, we don't clean up the exception object if a computed goto
leaves a catch block, but we can warn about that.

PR c++/81438

gcc/cp/ChangeLog:

* decl.cc (poplevel_named_label_1): Handle leaving catch.
(check_previous_goto_1): Likewise.
(check_goto_1): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/ext/label15.C: Require indirect_jumps.
* g++.dg/ext/label16.C: New test.
gcc/cp/decl.cc
gcc/testsuite/g++.dg/ext/label15.C
gcc/testsuite/g++.dg/ext/label16.C [new file with mode: 0644]