Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / cpp0x / noexcept06.C
blob7e1db661ec2c688ab48c2e125588ae73ea6af8b0
1 // Test that checking of a nothrow specification uses the one on the
2 // definition.
3 // { dg-do run { target c++11 } }
5 #include <exception>
6 #include <cstdlib>
8 void my_unexpected ()
10   std::abort ();
12 void my_terminate ()
14   std::exit (0);
17 void f() throw();
18 void f() noexcept
20   throw 1;
23 int main()
25   std::set_unexpected (my_unexpected);
26   std::set_terminate (my_terminate);
27   f();
28   return 1;