aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C
new file mode 100644
index 0000000..7e1db66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept06.C
@@ -0,0 +1,29 @@
+// Test that checking of a nothrow specification uses the one on the
+// definition.
+// { dg-do run { target c++11 } }
+
+#include <exception>
+#include <cstdlib>
+
+void my_unexpected ()
+{
+ std::abort ();
+}
+void my_terminate ()
+{
+ std::exit (0);
+}
+
+void f() throw();
+void f() noexcept
+{
+ throw 1;
+}
+
+int main()
+{
+ std::set_unexpected (my_unexpected);
+ std::set_terminate (my_terminate);
+ f();
+ return 1;
+}