diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index e434b42..18076cf 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -330,7 +330,7 @@ public: { if( flags_ != 1 ) { - std::error_code e2 = *this; + std::error_code e2( *this ); ::new( d2_ ) std::error_code( e2 ); flags_ = 1; } @@ -338,6 +338,14 @@ public: return *reinterpret_cast( d2_ ); } +#if defined(__clang__) && __clang_major__ < 7 + + template::value>::type> + operator T const& () = delete; + +#endif + #endif template