Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C

raw
1 // { dg-options "-O2 -fdump-tree-ehcleanup1-details" }
2
3 #ifdef __GXX_EXPERIMENTAL_CXX0X__
4 #define NOEXCEPT_FALSE noexcept (false)
5 #else
6 #define NOEXCEPT_FALSE
7 #endif
8
9 extern void can_throw ();
10 class a
11 {
12 public:
13 ~a () NOEXCEPT_FALSE
14 {
15 if (0)
16 can_throw ();
17 }
18 };
19 void
20 t (void)
21 {
22 class a a;
23 can_throw ();
24 }
25 // We ought to remove implicit cleanup, since destructor is empty.
26 // { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
27 //
28 // And as a result also contained control flow.
29 // { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }
30 //