Include and test system_error.hpp in warnings_test

This commit is contained in:
Peter Dimov
2020-06-17 01:13:16 +03:00
parent 73bf30ae04
commit f00c76a3fc
2 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,7 @@ namespace boost
virtual ~system_error() BOOST_NOEXCEPT_OR_NOTHROW {}
error_code code() const BOOST_NOEXCEPT { return m_error_code; }
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW;
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE;
private:
error_code m_error_code;

View File

@ -18,6 +18,7 @@
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#endif
#include <boost/system/system_error.hpp>
#include <boost/system/error_code.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cerrno>
@ -42,5 +43,10 @@ int main()
BOOST_TEST( bc == bn );
boost::system::system_error x( bc, "what_arg" );
BOOST_TEST_EQ( x.code(), bc );
BOOST_TEST_CSTR_EQ( x.what(), "what_arg" );
return boost::report_errors();
}