diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 45833eb..5cba48d 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -230,18 +230,20 @@ public: BOOST_SYSTEM_CONSTEXPR bool failed() const BOOST_NOEXCEPT { -#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) - - if( lc_flags_ == 1 ) + if( lc_flags_ & 1 ) { - std::error_code const& ec = *reinterpret_cast( d2_ ); - return ec.value() != 0; +#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) + if( lc_flags_ == 1 ) + { + std::error_code const& ec = *reinterpret_cast( d2_ ); + return ec.value() != 0; + } +#endif + return true; } else - -#endif { - return (lc_flags_ & 1) != 0; + return false; } }