public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7971] libstdc++: Workaround for LLVM-61763 in <ranges>
@ 2023-10-21 12:59 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-10-21 12:59 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:59047d969f1e1a6c224ae3f5f9bd69a9445cdad0
commit r13-7971-g59047d969f1e1a6c224ae3f5f9bd69a9445cdad0
Author: Benjamin Brock <brock@cs.berkeley.edu>
Date: Fri Oct 20 18:07:50 2023 +0100
libstdc++: Workaround for LLVM-61763 in <ranges>
This patch adds a small workaround that avoids declaring constrained
friends when compiling with Clang, instead making some members public.
MSVC's standard library has implemented a similar workaround.
Signed-off-by: Benjamin Brock <brock@cs.berkeley.edu>
libstdc++-v3/ChangeLog:
* include/std/ranges (zip_view, adjacent_view): Implement
workaround for LLVM-61763.
(cherry picked from commit be34a8b538c0f04b11a428bd1a9340eb19dec13f)
Diff:
---
libstdc++-v3/include/std/ranges | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index c4d4d85bf909..421197584873 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -4535,6 +4535,9 @@ namespace views::__adaptor
class zip_view<_Vs...>::_Iterator
: public __detail::__zip_view_iter_cat<_Const, _Vs...>
{
+#ifdef __clang__ // LLVM-61763 workaround
+ public:
+#endif
__detail::__tuple_or_pair_t<iterator_t<__detail::__maybe_const_t<_Const, _Vs>>...> _M_current;
constexpr explicit
@@ -4555,11 +4558,13 @@ namespace views::__adaptor
return input_iterator_tag{};
}
+#ifndef __clang__ // LLVM-61763 workaround
template<copy_constructible _Fp, input_range... _Ws>
requires (view<_Ws> && ...) && (sizeof...(_Ws) > 0) && is_object_v<_Fp>
&& regular_invocable<_Fp&, range_reference_t<_Ws>...>
&& std::__detail::__can_reference<invoke_result_t<_Fp&, range_reference_t<_Ws>...>>
friend class zip_transform_view;
+#endif
public:
// iterator_category defined in __zip_view_iter_cat
@@ -5230,6 +5235,9 @@ namespace views::__adaptor
template<bool _Const>
class adjacent_view<_Vp, _Nm>::_Iterator
{
+#ifdef __clang__ // LLVM-61763 workaround
+ public:
+#endif
using _Base = __detail::__maybe_const_t<_Const, _Vp>;
array<iterator_t<_Base>, _Nm> _M_current = array<iterator_t<_Base>, _Nm>();
@@ -5270,12 +5278,14 @@ namespace views::__adaptor
friend class adjacent_view;
+#ifndef __clang__ // LLVM-61763 workaround
template<forward_range _Wp, copy_constructible _Fp, size_t _Mm>
requires view<_Wp> && (_Mm > 0) && is_object_v<_Fp>
&& regular_invocable<__detail::__unarize<_Fp&, _Mm>, range_reference_t<_Wp>>
&& std::__detail::__can_reference<invoke_result_t<__detail::__unarize<_Fp&, _Mm>,
range_reference_t<_Wp>>>
friend class adjacent_transform_view;
+#endif
public:
using iterator_category = input_iterator_tag;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-21 12:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-21 12:59 [gcc r13-7971] libstdc++: Workaround for LLVM-61763 in <ranges> Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).