summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/eh5.C
blob: 59ed4dd5bd925122cdbf590647773ed3827bc257 (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" }

struct X {};

struct Y
{
  Y();
  virtual ~Y();
};

struct Z
{
  int f (const int *x);
  int g;
};

inline int
operator<< (Z &os, int x)
{
  os.f (&x);
  return os.g;
}

void foo (Z &a, X *b, X &c)
{
  X *d = b;
  int e = 0;
  Z &f = a;
  if (!(f << e))
    do { do { } while (&c == 0); throw Y(); } while (0);
  do { } while (&d == 0);
  do { } while (&c == 0);
}