diff --git a/include/boost/exception/detail/attribute_noreturn.hpp b/include/boost/exception/detail/attribute_noreturn.hpp index 1cb0763..f6a0b59 100644 --- a/include/boost/exception/detail/attribute_noreturn.hpp +++ b/include/boost/exception/detail/attribute_noreturn.hpp @@ -6,9 +6,7 @@ #ifndef UUID_61531AB0680611DEADD5846855D89593 #define UUID_61531AB0680611DEADD5846855D89593 -#include - -#if defined(BOOST_MSVC) +#if defined(_MSC_VER) #define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn) #elif defined(__GNUC__) #define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn)) diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index fbc0594..7e2a0e5 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -6,6 +6,10 @@ #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif + namespace boost { @@ -151,7 +155,6 @@ boost protected: - virtual ~error_info_container() throw() { } @@ -349,6 +352,10 @@ boost { } +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif template class clone_impl: @@ -382,6 +389,9 @@ boost throw*this; } }; +#ifdef _MSC_VER +#pragma warning(pop) +#endif } template diff --git a/test/1-throw_exception_test.cpp b/test/1-throw_exception_test.cpp index 06273bc..02e6b3b 100644 --- a/test/1-throw_exception_test.cpp +++ b/test/1-throw_exception_test.cpp @@ -6,6 +6,11 @@ #include #include +#include +#ifdef BOOST_MSVC +#pragma warning(disable:4702) //unreachable code +#endif + class my_exception: public std::exception { }; int diff --git a/test/3-throw_exception_no_integration_test.cpp b/test/3-throw_exception_no_integration_test.cpp index 6fa78f5..706b40d 100644 --- a/test/3-throw_exception_no_integration_test.cpp +++ b/test/3-throw_exception_no_integration_test.cpp @@ -7,6 +7,11 @@ #include #include +#include +#ifdef BOOST_MSVC +#pragma warning(disable:4702) //unreachable code +#endif + class my_exception: public std::exception { }; int