]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: throwing dtor and empty try [PR113088]
authorJason Merrill <jason@redhat.com>
Wed, 20 Dec 2023 16:06:27 +0000 (11:06 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 20 Dec 2023 17:31:07 +0000 (12:31 -0500)
commit02c0b49798228d777610f898cd9d63ebec43656d
tree0b0c9eaef863cace223f895163e0215917a2ee49
parent8dfc52a75d4d6c8be1c61b4aa831b1812b14a10e
c++: throwing dtor and empty try [PR113088]

maybe_splice_retval_cleanup assumed that the function body can't be empty if
there's a throwing cleanup, but when I added cleanups to try blocks in
r12-6333-gb10e031458d541 I didn't adjust that assumption.

PR c++/113088
PR c++/33799

gcc/cp/ChangeLog:

* except.cc (maybe_splice_retval_cleanup): Handle an empty block.

gcc/testsuite/ChangeLog:

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