From 134a6f7b107d265cfc55fd07744d9b8fd0283a0e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 11 Jan 2019 17:01:23 +0100 Subject: [PATCH] type_traits (__cpp_lib_is_constant_evaluated): Define. * include/std/type_traits (__cpp_lib_is_constant_evaluated): Define. * include/std/version (__cpp_lib_is_constant_evaluated): Define. From-SVN: r267847 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/std/type_traits | 3 +++ libstdc++-v3/include/std/version | 3 +++ 3 files changed, 11 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4c2470c6326..af7cf3eb389 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2019-01-11 Jakub Jelinek + + * include/std/type_traits (__cpp_lib_is_constant_evaluated): Define. + * include/std/version (__cpp_lib_is_constant_evaluated): Define. + 2019-01-11 Jonathan Wakely PR libstdc++/88802 diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 275a7f401fa..2df89acfd21 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3030,6 +3030,9 @@ template using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type; #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + +#define __cpp_lib_is_constant_evaluated 201811L + constexpr inline bool is_constant_evaluated() noexcept { return __builtin_is_constant_evaluated(); } diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index e11ae3a688a..903b75b483a 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -142,6 +142,9 @@ #if __cplusplus > 201703L // c++2a +#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED +# define __cpp_lib_is_constant_evaluated 201811L +#endif #define __cpp_lib_list_remove_return_type 201806L #endif // C++2a #endif // C++17 -- 2.30.2