diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index bf90d08..55183b8 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -125,6 +125,7 @@ else
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : static : single_instance_lib_static ]
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : shared : single_instance_lib_shared ]
[ system-run before_main_test.cpp ]
+ [ run-fail throws_assign_fail.cpp ]
;
# Quick (CI) test
diff --git a/test/throws_assign_fail.cpp b/test/throws_assign_fail.cpp
new file mode 100644
index 0000000..8453577
--- /dev/null
+++ b/test/throws_assign_fail.cpp
@@ -0,0 +1,28 @@
+
+// Copyright 2018 Peter Dimov.
+// Distributed under the Boost Software License, Version 1.0.
+
+#include
+
+using namespace boost::system;
+
+static void f( error_code & ec )
+{
+ ec = error_code();
+}
+
+#if defined(_WIN32)
+# include // SetErrorMode
+#endif
+
+int main()
+{
+#if defined(_WIN32)
+
+ SetErrorMode( SetErrorMode( 0 ) | SEM_NOGPFAULTERRORBOX );
+
+#endif
+
+ // this should crash
+ f( boost::throws() );
+}