]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add always_inline to std::is_constant_evaluated()
authorJonathan Wakely <jwakely@redhat.com>
Thu, 22 May 2025 11:09:08 +0000 (12:09 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 23 May 2025 16:46:40 +0000 (17:46 +0100)
We already have the attribute on std::__is_constant_evaluated() but for
some reason not on std::is_constant_evaluated().

libstdc++-v3/ChangeLog:

* include/std/type_traits (is_constant_evaluated): Add
always_inline attribute.

libstdc++-v3/include/std/type_traits

index 0601869266c9e5bcdb605a55f67ac3145618f27a..6bf355d97cc9b119d785a095e678d50dbe06e4fa 100644 (file)
@@ -4019,7 +4019,8 @@ template<typename _Ret, typename _Fn, typename... _Args>
 #ifdef __cpp_lib_is_constant_evaluated // C++ >= 20 && HAVE_IS_CONST_EVAL
   /// Returns true only when called during constant evaluation.
   /// @since C++20
-  constexpr inline bool
+  [[__gnu__::__always_inline__]]
+  constexpr bool
   is_constant_evaluated() noexcept
   {
 #if __cpp_if_consteval >= 202106L