diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr91355.C')
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr91355.C | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr91355.C b/gcc/testsuite/g++.dg/torture/pr91355.C new file mode 100644 index 000000000000..7a385dc5bdd0 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr91355.C @@ -0,0 +1,28 @@ +// 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 (); +} |