]> gcc.gnu.org Git - 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, 24 Jan 2024 19:38:53 +0000 (14:38 -0500)
commit60bfd373a1891ae2349dc67313d104079ce8c706
tree9ccc2eced60f3cc152a24269047ac92f69770c15
parent2b7204c52392c1c0da9c91a5feae0c44018a6f37
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.

(cherry picked from commit 02c0b49798228d777610f898cd9d63ebec43656d)
gcc/cp/except.cc
gcc/testsuite/g++.dg/eh/return2.C [new file with mode: 0644]
This page took 0.059329 seconds and 5 git commands to generate.