[gcc r16-848] libstdc++: Add always_inline to std::is_constant_evaluated()

Jonathan Wakely redi@gcc.gnu.org
Fri May 23 16:47:13 GMT 2025


https://gcc.gnu.org/g:b2aeeb2803f97bc560ce5e65ab18e6ba7d8fa621

commit r16-848-gb2aeeb2803f97bc560ce5e65ab18e6ba7d8fa621
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu May 22 12:09:08 2025 +0100

    libstdc++: Add always_inline to std::is_constant_evaluated()
    
    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.

Diff:
---
 libstdc++-v3/include/std/type_traits | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 0601869266c9..6bf355d97cc9 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -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


More information about the Libstdc++-cvs mailing list