Message ID | 20190111155138.GO30353@tucnak |
---|---|
State | New |
Headers | show |
Series | Define __cpp_lib_is_constant_evaluated | expand |
On 11/01/19 16:51 +0100, Jakub Jelinek wrote: >Hi! > >Seems __cpp_lib_is_constant_evaluated should be defined to 201811L >if std::is_constant_evaluated() is implemented. > >Ok for trunk? OK, thanks. >2019-01-11 Jakub Jelinek <jakub@redhat.com> > > * include/std/type_traits (__cpp_lib_is_constant_evaluated): Define. > * include/std/version (__cpp_lib_is_constant_evaluated): Define. > >--- libstdc++-v3/include/std/type_traits.jj 2019-01-01 12:45:50.842546655 +0100 >+++ libstdc++-v3/include/std/type_traits 2019-01-11 16:44:39.546916488 +0100 >@@ -3030,6 +3030,9 @@ template <typename _From, typename _To> > 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(); } >--- libstdc++-v3/include/std/version.jj 2019-01-10 16:42:18.081062695 +0100 >+++ libstdc++-v3/include/std/version 2019-01-11 16:48:35.944119391 +0100 >@@ -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 > > Jakub
--- libstdc++-v3/include/std/type_traits.jj 2019-01-01 12:45:50.842546655 +0100 +++ libstdc++-v3/include/std/type_traits 2019-01-11 16:44:39.546916488 +0100 @@ -3030,6 +3030,9 @@ template <typename _From, typename _To> 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(); } --- libstdc++-v3/include/std/version.jj 2019-01-10 16:42:18.081062695 +0100 +++ libstdc++-v3/include/std/version 2019-01-11 16:48:35.944119391 +0100 @@ -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