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.
---

Tested x86_64-linux.

Pushed to trunk.

 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
-- 
2.49.0

Reply via email to