[libc++] Workaround failures with modules on Clang ToT

This commit is contained in:
Louis Dionne 2021-07-08 11:11:07 -04:00
parent 63cc251eb9
commit 6afd6e96ce
4 changed files with 10 additions and 1 deletions

View File

@ -178,6 +178,9 @@ public:
_LIBCPP_UNREACHABLE();
}
// TODO: Remove this workaround for broken Clang modules.
using __function_like::operator&;
};
inline constexpr auto advance = __advance_fn(__function_like::__tag());

View File

@ -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());

View File

@ -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());

View File

@ -17,7 +17,7 @@ constexpr bool is_addressable = requires(T t) {
};
template <class T>
[[nodiscard]] constexpr bool is_function_like() {
constexpr bool is_function_like() {
using X = std::remove_cvref_t<T>;
static_assert(!is_addressable<X>);
static_assert(!is_addressable<X const>);