gcc/testsuite/g++.dg/eh/cleanup6.C
raw| 1 | // Test that we don't wrap the non-throwing A cleanup with a B cleanup. |
| 2 | |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | // { dg-additional-options -fdump-tree-gimple } |
| 5 | // { dg-final { scan-tree-dump-times "B::~B" 1 "gimple" } } |
| 6 | |
| 7 | struct A { A(); ~A(); }; |
| 8 | struct B { B(const A& = A()); ~B(); }; |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | B b; |
| 13 | } |