mirror of
https://github.com/boostorg/describe.git
synced 2026-01-19 04:12:07 +00:00
Move C++20 detection to detail/config.hpp; disable C++20 use for Clang < 13.
This commit is contained in:
@@ -45,4 +45,20 @@
|
||||
|
||||
#define BOOST_DESCRIBE_INLINE_CONSTEXPR BOOST_DESCRIBE_INLINE_VARIABLE BOOST_DESCRIBE_CONSTEXPR_OR_CONST
|
||||
|
||||
#if __cplusplus >= 202002L || ( defined(_MSVC_LANG) && _MSVC_LANG >= 202002L )
|
||||
|
||||
# define BOOST_DESCRIBE_CXX20
|
||||
|
||||
// Clang 13.0 is needed for unevaluated lambdas
|
||||
# if defined(__clang__) && __clang_major__ < 13
|
||||
# undef BOOST_DESCRIBE_CXX20
|
||||
# endif
|
||||
|
||||
// Apple Clang 13.1 is Clang 13.0
|
||||
# if defined(__clang__) && defined(__apple_build_version__) && __clang_major__ == 13 && __clang_minor__ < 1
|
||||
# undef BOOST_DESCRIBE_CXX20
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_DETAIL_CONFIG_HPP_INCLUDED
|
||||
|
||||
@@ -43,7 +43,7 @@ template<class... T> auto enum_descriptor_fn_impl( int, T... )
|
||||
return list<enum_descriptor<T>...>();
|
||||
}
|
||||
|
||||
#if __cplusplus >= 202002L || ( defined(_MSVC_LANG) && _MSVC_LANG >= 202002L )
|
||||
#if defined(BOOST_DESCRIBE_CXX20)
|
||||
|
||||
template<auto V, auto N> struct enum_desc
|
||||
{
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#if BOOST_CXX_VERSION < 202002L
|
||||
#if !defined(BOOST_DESCRIBE_CXX20)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_CXX_VERSION < 202002L")
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_DESCRIBE_CXX20 isn't defined")
|
||||
|
||||
#else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user