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