diff --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h index 4971bebfed864..a903e45cec51d 100644 --- a/libcxx/include/__iterator/advance.h +++ b/libcxx/include/__iterator/advance.h @@ -178,6 +178,9 @@ struct __advance_fn final : __function_like { _LIBCPP_UNREACHABLE(); } + + // TODO: Remove this workaround for broken Clang modules. + using __function_like::operator&; }; inline constexpr auto advance = __advance_fn(__function_like::__tag()); diff --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h index af719e3cab113..5db5b2fd5875e 100644 --- a/libcxx/include/__iterator/next.h +++ b/libcxx/include/__iterator/next.h @@ -68,6 +68,9 @@ struct __next_fn final : private __function_like { ranges::advance(__x, __n, __bound); return __x; } + + // TODO: Remove this workaround for broken Clang modules. + using __function_like::operator&; }; inline constexpr auto next = __next_fn(__function_like::__tag()); diff --git a/libcxx/include/__iterator/prev.h b/libcxx/include/__iterator/prev.h index f1ba2be5ff950..1fc2b9c73f1a2 100644 --- a/libcxx/include/__iterator/prev.h +++ b/libcxx/include/__iterator/prev.h @@ -61,6 +61,9 @@ struct __prev_fn final : private __function_like { ranges::advance(__x, -__n, __bound); return __x; } + + // TODO: Remove this workaround for broken Clang modules. + using __function_like::operator&; }; inline constexpr auto prev = __prev_fn(__function_like::__tag()); diff --git a/libcxx/test/support/test_standard_function.h b/libcxx/test/support/test_standard_function.h index f24d2acb81db0..1e207cfdac00b 100644 --- a/libcxx/test/support/test_standard_function.h +++ b/libcxx/test/support/test_standard_function.h @@ -17,7 +17,7 @@ constexpr bool is_addressable = requires(T t) { }; template -[[nodiscard]] constexpr bool is_function_like() { +constexpr bool is_function_like() { using X = std::remove_cvref_t; static_assert(!is_addressable); static_assert(!is_addressable);