summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
blob: 0ebaab41fa66d94c498a62b3156f4768ef59273f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run { xfail sparc64-*-elf z8k-*-* arm-*-pe } }
// { dg-require-effective-target c++14_down }
// { dg-options "-fexceptions" }

#include <exception>

void my_unexpected() {
  throw 42;
}

template <class T> void foo(T) throw (int) { throw "Hi"; }	// { dg-warning "deprecated" "" { target c++11 } }

main() {
  std::set_unexpected (my_unexpected);
  try {
    foo(1);
  } catch (int i) {
    if (i == 42)
      return 0;
  }
  return 1;
}