c++: nested catch in ctor fn-try-block [PR61611]
authorJason Merrill <jason@redhat.com>
Thu, 6 Jan 2022 14:45:26 +0000 (09:45 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 7 Jan 2022 00:25:43 +0000 (19:25 -0500)
commit6ad76e73375a9c00a0a5f5729ae70bce7a6db5bc
tree8bef3fdb4867b142b1006f4dc37069f47bcfc8cf
parentb10e031458d541f794dfaa08ba606487603a4bb6
c++: nested catch in ctor fn-try-block [PR61611]

Being in_function_try_handler isn't enough to satisfy the condition of
reaching the end of such a handler; in this case, we're reaching the end of
a handler within that handler, so we don't want the special semantics.

PR c++/61611

gcc/cp/ChangeLog:

* except.c (in_nested_catch): New.
(expand_end_catch_block): Check it.

gcc/testsuite/ChangeLog:

* g++.dg/eh/ctor-fntry1.C: New test.
gcc/cp/except.c
gcc/testsuite/g++.dg/eh/ctor-fntry1.C [new file with mode: 0644]