From af12ea6785e0753568d0350cf1411c019ce03873 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 12 Jan 2019 08:03:54 +0200 Subject: [PATCH] Use __has_cpp_attribute instead of checking the Clang version --- include/boost/mp11/detail/config.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/mp11/detail/config.hpp b/include/boost/mp11/detail/config.hpp index 607bef0..7d2cdcf 100644 --- a/include/boost/mp11/detail/config.hpp +++ b/include/boost/mp11/detail/config.hpp @@ -123,10 +123,16 @@ // BOOST_MP11_DEPRECATED(msg) -#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_CLANG, < 304 ) +#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 ) # define BOOST_MP11_DEPRECATED(msg) -#elif BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 50000 ) || BOOST_MP11_WORKAROUND( BOOST_MP11_CLANG, < 309 ) +#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 +# define BOOST_MP11_DEPRECATED(msg) +# endif #else # define BOOST_MP11_DEPRECATED(msg) [[deprecated(msg)]] #endif