Use -Wno-deprecated for std::uncaught_exception tests.
[gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / eh48.C
1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions -Wno-deprecated" }
3
4 #include <exception>
5 #include <stdlib.h>
6
7 using std::uncaught_exception;
8 class A {
9 public:
10 ~A() {
11 if (uncaught_exception ())
12 exit (0);
13 }
14 };
15
16 int main() {
17 if (uncaught_exception ())
18 return 1;
19 try {
20 throw "";
21 } catch (...) {
22 if (uncaught_exception ())
23 return 1;
24 }
25 if (uncaught_exception ())
26 return 1;
27 try {
28 A a;
29 throw "";
30 } catch (...) {
31 return 1;
32 }
33 return 1;
34 }