summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/nested-try.C
blob: 5796f9a28060ceffffd76dcf6a7ca07eae00cc02 (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
// { dg-do compile }
// Nested try statements shadowing each other was crashing in EH edge redirection.
// PR middle-end/40043
struct A
{
  ~A();
  void foo();
};

void bar()
{
  A a;

  try
  {
    A b;

    try
    {
      b.foo();
    }
    catch (int) {}
  }
  catch (int) {}
}