view gcc/testsuite/g++.old-deja/g++.other/eh5.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { 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);
}