* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept04.C
blob56ea1f48b8d0e0ed265fdfac31828103d30fdebd
1 // Make sure that we call terminate when a noexcept spec is violated.
2 // The function pointers are there to make sure that
3 // the compiler doesn't get clever about optimizing the calls based on
4 // knowledge about the called functions.
6 // { dg-do run { target c++11 } }
8 #include <exception>
9 #include <cstdlib>
11 void my_terminate ()
13   std::exit (0);
16 void g() { throw 1; }
17 void (*p1)() = g;
18 void f() noexcept { p1(); }
19 void (*p2)() = f;
20 void h() { p2(); }
22 int main()
24   std::set_terminate (my_terminate);
26   try { h(); }
27   catch (int) { }
29   return 1;