1 // Test that checking of a nothrow specification uses the one on the
2 // definition.
3 // { dg-options "-std=c++0x" }
4 // { dg-do run }
5 
6 #include <exception>
7 #include <cstdlib>
8 
my_unexpected()9 void my_unexpected ()
10 {
11   std::exit (0);
12 }
13 
14 void f() noexcept;
f()15 void f() throw()
16 {
17   throw 1;
18 }
19 
main()20 int main()
21 {
22   std::set_unexpected (my_unexpected);
23   f();
24   return 1;
25 }
26