Skip to content

Commit d70e50b

Browse files
committed
[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.
1 parent 2147346 commit d70e50b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/include/__type_traits/invoke.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ inline const bool __is_invocable_r_v = __is_invocable_r_impl<_Ret, __is_invocabl
112112
template <bool __is_invocable, class... _Args>
113113
inline const bool __is_nothrow_invocable_impl = false;
114114

115+
# ifndef _LIBCPP_CXX03_LANG
115116
template <class... _Args>
116117
inline const bool __is_nothrow_invocable_impl<true, _Args...> = noexcept(__builtin_invoke(std::declval<_Args>()...));
118+
# endif
117119

118120
template <class... _Args>
119121
inline const bool __is_nothrow_invocable_v = __is_nothrow_invocable_impl<__is_invocable_v<_Args...>, _Args...>;

0 commit comments

Comments
 (0)