From 8e60b42fa037253f0f515b57d790aa67a47f308e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 12 Jan 2019 18:23:06 +0200 Subject: [PATCH] Check [[fallthrough]] in addition to [[deprecated]] to eliminate Clang 3.8 --- include/boost/mp11/detail/config.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/boost/mp11/detail/config.hpp b/include/boost/mp11/detail/config.hpp index 7d2cdcf..63c21f4 100644 --- a/include/boost/mp11/detail/config.hpp +++ b/include/boost/mp11/detail/config.hpp @@ -127,10 +127,17 @@ # define BOOST_MP11_DEPRECATED(msg) #elif BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 50000 ) # define BOOST_MP11_DEPRECATED(msg) __attribute__((deprecated(msg))) -#elif defined(__has_cpp_attribute) -# if __has_cpp_attribute(deprecated) -# define BOOST_MP11_DEPRECATED(msg) [[deprecated(msg)]] -# else +#elif BOOST_MP11_CLANG +# if defined(__has_cpp_attribute) +// 3.8 warns about [[deprecated]] when in C++11 mode +// so we only use it on 3.9 and above, detected via [[fallthrough]] +// can't version check because Apple +# if __has_cpp_attribute(deprecated) && __has_cpp_attribute(fallthrough) +# define BOOST_MP11_DEPRECATED(msg) [[deprecated(msg)]] +# else +# define BOOST_MP11_DEPRECATED(msg) +# endif +# else // defined(__has_cpp_attribute) # define BOOST_MP11_DEPRECATED(msg) # endif #else