summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/cleanup4.C
blob: 8bdaa1977807f4490cc924d30bd3da968a5ea613 (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
31
32
33
34
// { dg-do assemble  }
// { dg-options "-O2 -fno-exceptions" }
// Origin: Jakub Jelinek  <jakub@redhat.com>

class foo
{
public:
  foo ();
  ~foo ();
};

class bar
{
public:
  bar ();
  bar (const foo&);
};

int i;
foo f ();

inline bar x ()
{
  switch (i)
    {
    case 0: return bar (f ());
    default: return bar ();
    }
}

bar y ()
{
  return x ();
}