Check [[fallthrough]] in addition to [[deprecated]] to eliminate Clang 3.8

This commit is contained in:
Peter Dimov
2019-01-12 18:23:06 +02:00
parent af12ea6785
commit 8e60b42fa0

View File

@@ -127,10 +127,17 @@
# define BOOST_MP11_DEPRECATED(msg) # define BOOST_MP11_DEPRECATED(msg)
#elif BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 50000 ) #elif BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 50000 )
# define BOOST_MP11_DEPRECATED(msg) __attribute__((deprecated(msg))) # define BOOST_MP11_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif defined(__has_cpp_attribute) #elif BOOST_MP11_CLANG
# if __has_cpp_attribute(deprecated) # if defined(__has_cpp_attribute)
# define BOOST_MP11_DEPRECATED(msg) [[deprecated(msg)]] // 3.8 warns about [[deprecated]] when in C++11 mode
# else // 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) # define BOOST_MP11_DEPRECATED(msg)
# endif # endif
#else #else