Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for impending LLVM 17 release #4014

Merged
merged 8 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -8213,9 +8213,13 @@ namespace ranges {
private:
friend zip_view;

#ifdef __clang__ // TRANSITION, LLVM-61763
public:
#else // ^^^ workaround / no workaround vvv
template <class _Func, class... _OtherViews>
requires _Zip_transform_constraints<_Func, _OtherViews...>
friend class zip_transform_view;
#endif // ^^^ no workaround ^^^

using _My_tuple = tuple<iterator_t<_Maybe_const<_IsConst, _ViewTypes>>...>;

Expand Down Expand Up @@ -9047,7 +9051,7 @@ namespace ranges {
private:
friend adjacent_view;

#ifdef __clang__ // TRANSITION, Clang 17
#ifdef __clang__ // TRANSITION, LLVM-61763
public:
#else // ^^^ workaround / no workaround vvv
template <class _Vw2, class _Fn, size_t _Nx2>
Expand Down
33 changes: 33 additions & 0 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,38 @@ _EXPORT_STD [[noreturn]] __forceinline void unreachable() noexcept /* strengthen
#endif // defined(_DEBUG)
}

#ifdef __clang__ // TRANSITION, LLVM-64029
// Clang 17 implements forward_like directly and is confused by our deduced return type
template <bool isConst, bool isLvalue>
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved
struct _Dispatch_forward_like {
template <class _Ty>
using _Apply = const _Ty&;
};
template <>
struct _Dispatch_forward_like<false, false> {
template <class _Ty>
using _Apply = _Ty&&;
};
template <>
struct _Dispatch_forward_like<false, true> {
template <class _Ty>
using _Apply = _Ty&;
};
template <>
struct _Dispatch_forward_like<true, false> {
template <class _Ty>
using _Apply = const _Ty&&;
};

template <class _Ty, class _Uty>
using _Forward_like_t = typename _Dispatch_forward_like<is_const_v<remove_reference_t<_Ty>>,
is_lvalue_reference_v<_Ty>>::template _Apply<remove_reference_t<_Uty>>;

_EXPORT_STD template <class _Ty, class _Uty>
_NODISCARD constexpr _Forward_like_t<_Ty, _Uty> forward_like(_Uty&& _Ux) noexcept {
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved
return static_cast<_Forward_like_t<_Ty, _Uty>>(_Ux);
}
#else // ^^^ workaround / no workaround vvv
_EXPORT_STD template <class _Ty, class _Uty>
_NODISCARD _MSVC_INTRINSIC constexpr auto&& forward_like(_Uty&& _Ux) noexcept {
static_assert(_Can_reference<_Ty>, "std::forward_like's first template argument must be a referenceable type.");
Expand All @@ -950,6 +982,7 @@ _NODISCARD _MSVC_INTRINSIC constexpr auto&& forward_like(_Uty&& _Ux) noexcept {

template <class _Ty, class _Uty>
using _Forward_like_t = decltype(_STD forward_like<_Ty>(_STD declval<_Uty&>()));
#endif // ^^^ no workaround ^^^
#endif // _HAS_CXX23

#if _HAS_TR1_NAMESPACE
Expand Down