From c6bff94709db7493d37be23ad2e71a2b8f19c421 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Feb 2022 04:35:44 +0200 Subject: [PATCH] Update std_interop_test12.cpp --- test/std_interop_test12.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/std_interop_test12.cpp b/test/std_interop_test12.cpp index c46356e..36a66fc 100644 --- a/test/std_interop_test12.cpp +++ b/test/std_interop_test12.cpp @@ -92,7 +92,11 @@ template<> struct std::is_error_code_enum: std::true_type {}; boost::system::error_code make_error_code( my_errc e ) { - static BOOST_SYSTEM_CONSTEXPR my_category cat; + // If `cat` is declared constexpr or const, msvc-14.1 and + // msvc-14.2 before 19.29 put it in read-only memory, + // despite the `ps_` member being mutable. So it crashes. + + static /*BOOST_SYSTEM_CONSTEXPR*/ my_category cat; return boost::system::error_code( e, cat ); }