• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright 2018 Peter Dimov.
3 // Distributed under the Boost Software License, Version 1.0.
4 
5 #include <boost/system/error_code.hpp>
6 
7 using namespace boost::system;
8 
f(error_code & ec)9 static void f( error_code & ec )
10 {
11     ec = error_code();
12 }
13 
14 #if defined(_WIN32)
15 # include <windows.h> // SetErrorMode
16 #endif
17 
main()18 int main()
19 {
20 #if defined(_WIN32)
21 
22     SetErrorMode( SetErrorMode( 0 ) | SEM_NOGPFAULTERRORBOX );
23 
24 #endif
25 
26     // this should crash
27     f( boost::throws() );
28 }
29