aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
blob: 0c383501003230b302406ab3d49ced06c512a7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Special g++ Options: -fexceptions
// excess errors test - XFAIL a29k-*-* sparc64-*-elf z8k-*-* arm-*-pe

#include <exception>

void my_unexpected() {
  throw 42;
}

void foo() throw (int) { throw "Hi"; }

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