view gcc/testsuite/g++.dg/torture/pr91355.C @ 145:1830386684a0

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

// PR tree-optimization/91355
// { dg-do run }
// { dg-options "-std=c++14" }

unsigned int d = 0;

struct S {
  S () { d++; }
  S (const S &) { d++; }
  ~S () { d--; }
};

void
foo (int i) throw (int) // { dg-warning "dynamic exception specifications are deprecated" }
{
  if (i == 0)
    throw 3;
  S d;
  throw 3;
}

int
main ()
{
  try { foo (1); } catch (...) {}
  if (d)
    __builtin_abort ();
}