Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.mike/eh50.C

raw
1 // { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
2 // { dg-require-effective-target c++14_down }
3 // { dg-options "-fexceptions" }
4
5 #include <exception>
6
7 void my_unexpected() {
8 throw 42;
9 }
10
11 template <class T> void foo(T) throw (int) { throw "Hi"; } // { dg-warning "deprecated" "" { target c++11 } }
12
13 int
14 main() {
15 std::set_unexpected (my_unexpected); // { dg-warning "deprecated" "" { target c++11 } }
16 try {
17 foo(1);
18 } catch (int i) {
19 if (i == 42)
20 return 0;
21 }
22 return 1;
23 }