aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
blob: d6e4cf37205958b5cfbe95611623f869546d5452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// { dg-options "-O2 -fdump-tree-ehcleanup1-details" }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#define NOEXCEPT_FALSE noexcept (false)
#else
#define NOEXCEPT_FALSE
#endif

extern void can_throw ();
class a
{
public:
  ~a () NOEXCEPT_FALSE
  {
    if (0)
      can_throw ();
  }
};
void
t (void)
{
  class a a;
  can_throw ();
}
// We ought to remove implicit cleanup, since destructor is empty. 
// { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
//
// And as a result also contained control flow.
// { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }
//