[libcxx-commits] [libcxx] d70e50b - [libc++] Don't try to used noexcept in C++03
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 12 11:32:08 PDT 2025
Author: Nikolas Klauser
Date: 2025-08-12T20:31:00+02:00
New Revision: d70e50b0da85970ddcbb632e6068d558a7cce5e6
URL: https://github.com/llvm/llvm-project/commit/d70e50b0da85970ddcbb632e6068d558a7cce5e6
DIFF: https://github.com/llvm/llvm-project/commit/d70e50b0da85970ddcbb632e6068d558a7cce5e6.diff
LOG: [libc++] Don't try to used noexcept in C++03
`__is_nothrow_invocable` isn't used in C++03, so we never noticed that
it's not `constexpr`. This is caught by the clang-tidy ADL check
with LLVM 22, since it's treated like a normal function call in C++03.
It's only caught with LLVM 22, since `__builtin_invoke` wasn't available
before.
Added:
Modified:
libcxx/include/__type_traits/invoke.h
Removed:
################################################################################
diff --git a/libcxx/include/__type_traits/invoke.h b/libcxx/include/__type_traits/invoke.h
index 3f5626c014432..24702b6d5b52b 100644
--- a/libcxx/include/__type_traits/invoke.h
+++ b/libcxx/include/__type_traits/invoke.h
@@ -112,8 +112,10 @@ inline const bool __is_invocable_r_v = __is_invocable_r_impl<_Ret, __is_invocabl
template <bool __is_invocable, class... _Args>
inline const bool __is_nothrow_invocable_impl = false;
+# ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
inline const bool __is_nothrow_invocable_impl<true, _Args...> = noexcept(__builtin_invoke(std::declval<_Args>()...));
+# endif
template <class... _Args>
inline const bool __is_nothrow_invocable_v = __is_nothrow_invocable_impl<__is_invocable_v<_Args...>, _Args...>;
More information about the libcxx-commits
mailing list