Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/noexcept07.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 // Test that checking of a nothrow specification uses the one on the |
2 // definition. In C++17 throw() is equivalent to noexcept(true). | |
3 // { dg-do run { target { c++11 && c++14_down } } } | |
4 | |
5 #include <exception> | |
6 #include <cstdlib> | |
7 | |
8 void my_unexpected () | |
9 { | |
10 std::exit (0); | |
11 } | |
12 | |
13 void f() noexcept; | |
14 void f() throw() | |
15 { | |
16 throw 1; | |
17 } | |
18 | |
19 int main() | |
20 { | |
21 std::set_unexpected (my_unexpected); | |
22 f(); | |
23 return 1; | |
24 } |