From 7f42d987e77ca6bb0a47851113dd3772551c821a Mon Sep 17 00:00:00 2001 From: "K. Noel Belcourt" Date: Fri, 26 May 2017 12:33:59 -0600 Subject: [PATCH 1/2] Protect clang pragmas with BOOST_CLANG macro. --- include/boost/smart_ptr/bad_weak_ptr.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/smart_ptr/bad_weak_ptr.hpp b/include/boost/smart_ptr/bad_weak_ptr.hpp index 582fad8..47d7783 100644 --- a/include/boost/smart_ptr/bad_weak_ptr.hpp +++ b/include/boost/smart_ptr/bad_weak_ptr.hpp @@ -36,10 +36,12 @@ namespace boost # pragma option push -pc #endif +#if defined(BOOST_CLANG) #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wweak-vtables" #endif +#endif class bad_weak_ptr: public std::exception { @@ -51,9 +53,11 @@ public: } }; +#if defined(BOOST_CLANG) #if defined(__clang__) # pragma clang diagnostic pop #endif +#endif #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 # pragma option pop From b530ffcae55816723714409a461665edfdbcbf70 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 May 2017 03:01:34 +0300 Subject: [PATCH 2/2] Remove redundant check; add coment; include config.hpp --- include/boost/smart_ptr/bad_weak_ptr.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/smart_ptr/bad_weak_ptr.hpp b/include/boost/smart_ptr/bad_weak_ptr.hpp index 47d7783..b086be5 100644 --- a/include/boost/smart_ptr/bad_weak_ptr.hpp +++ b/include/boost/smart_ptr/bad_weak_ptr.hpp @@ -17,6 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include #include #ifdef __BORLANDC__ @@ -37,11 +38,10 @@ namespace boost #endif #if defined(BOOST_CLANG) -#if defined(__clang__) +// Intel C++ on Mac defines __clang__ but doesn't support the pragma # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wweak-vtables" #endif -#endif class bad_weak_ptr: public std::exception { @@ -54,10 +54,8 @@ public: }; #if defined(BOOST_CLANG) -#if defined(__clang__) # pragma clang diagnostic pop #endif -#endif #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 # pragma option pop