Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / eh50.C
blob028a2de0c238f4c17a6aed78b8cbbfed67fcbbbd
1 // { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
2 // { dg-require-effective-target c++14_down }
3 // { dg-options "-fexceptions" }
5 #include <exception>
7 void my_unexpected() {
8   throw 42;
11 template <class T> void foo(T) throw (int) { throw "Hi"; }      // { dg-warning "deprecated" "" { target c++11 } }
13 int
14 main() {
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;