[libc++] Move constexpr/explicit macros to <__configuration/language.h> (#205535)

These macros are essentially a property of the language mode we're in,
so move them to `<__configuration/language.h>`.
This commit is contained in:
Nikolas Klauser 2026-06-24 14:14:15 +02:00 committed by GitHub
parent 09058457ee
commit 94819d04c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 36 deletions

View file

@ -238,42 +238,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0
# endif
# if _LIBCPP_STD_VER <= 11
# define _LIBCPP_EXPLICIT_SINCE_CXX14
# else
# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
# endif
# if _LIBCPP_STD_VER >= 14
# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX14
# endif
# if _LIBCPP_STD_VER >= 17
# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX17
# endif
# if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX20
# endif
# if _LIBCPP_STD_VER >= 23
# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX23
# endif
# if _LIBCPP_STD_VER >= 26
# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
# else
# define _LIBCPP_CONSTEXPR_SINCE_CXX26
# endif
// Thread API
// clang-format off
# if _LIBCPP_HAS_THREADS && \

View file

@ -56,4 +56,40 @@
# define _LIBCPP_HAS_CHAR8_T 1
#endif
#if _LIBCPP_STD_VER <= 11
# define _LIBCPP_EXPLICIT_SINCE_CXX14
#else
# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
#endif
#if _LIBCPP_STD_VER >= 14
# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
#else
# define _LIBCPP_CONSTEXPR_SINCE_CXX14
#endif
#if _LIBCPP_STD_VER >= 17
# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
#else
# define _LIBCPP_CONSTEXPR_SINCE_CXX17
#endif
#if _LIBCPP_STD_VER >= 20
# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
#else
# define _LIBCPP_CONSTEXPR_SINCE_CXX20
#endif
#if _LIBCPP_STD_VER >= 23
# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
#else
# define _LIBCPP_CONSTEXPR_SINCE_CXX23
#endif
#if _LIBCPP_STD_VER >= 26
# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
#else
# define _LIBCPP_CONSTEXPR_SINCE_CXX26
#endif
#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H