aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C
new file mode 100644
index 0000000..90c50a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept07.C
@@ -0,0 +1,24 @@
+// 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::exit (0);
+}
+
+void f() noexcept;
+void f() throw()
+{
+ throw 1;
+}
+
+int main()
+{
+ std::set_unexpected (my_unexpected);
+ f();
+ return 1;
+}