c++: don't wrap cleanups that can't throw
Since C++11, the vast majority of destructors are noexcept, so wrap_temporary_cleanups adds a bunch of useless TRY_CATCH_EXPR to be removed later in the optimizers. It's simple to avoid adding them in the first place. gcc/cp/ChangeLog: * decl.c (wrap_cleanups_r): Don't wrap if noexcept. gcc/testsuite/ChangeLog: * g++.dg/eh/cleanup6.C: New test.
gcc/testsuite/g++.dg/eh/cleanup6.C
0 → 100644
Please register or sign in to comment