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 my_unexpected()7void my_unexpected() { 8 throw 42; 9 } 10 foo()11void foo() throw (int) { throw "Hi"; } // { dg-warning "deprecated" "" { target c++11 } } 12 main()13int main() { 14 std::set_unexpected (my_unexpected); 15 try { 16 foo(); 17 } catch (int i) { 18 if (i == 42) 19 return 0; 20 } 21 return 1; 22 } 23