Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/eh33.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 | |
7 void my_unexpected() { | |
8 throw 42; | |
9 } | |
10 | |
11 void foo() throw (int) { throw "Hi"; } // { dg-warning "deprecated" "" { target c++11 } } | |
12 | |
13 int main() { | |
14 std::set_unexpected (my_unexpected); | |
15 try { | |
16 foo(); | |
17 } catch (int i) { | |
18 if (i == 42) | |
19 return 0; | |
20 } | |
21 return 1; | |
22 } |