8sa1-gcc/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
Jason Merrill 6e940d05f4 new, update
From-SVN: r19649
1998-05-09 14:08:52 -04:00

22 lines
387 B
C

// Special g++ Options: -fexceptions
// excess errors test - XFAIL hppa*-*-* a29k-*-* sparc64-*-elf sh-*-* z8k-*-* arm-*-pe**-*
#include <exception>
void my_unexpected() {
throw 42;
}
template <class T> int foo(T) throw (int) { throw "Hi"; }
main() {
std::set_unexpected (my_unexpected);
try {
foo(1);
} catch (int i) {
if (i == 42)
return 0;
}
return 1;
}