Skip to content
Snippets Groups Projects
  • Jason Merrill's avatar
    092e60f5
    c++: don't wrap cleanups that can't throw · 092e60f5
    Jason Merrill authored
    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.
    092e60f5
    History
    c++: don't wrap cleanups that can't throw
    Jason Merrill authored
    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.