* [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges
@ 2023-10-16 3:55 Benjamin Acker Brock
2023-10-21 11:16 ` Jonathan Wakely
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Acker Brock @ 2023-10-16 3:55 UTC (permalink / raw)
To: gcc-patches; +Cc: libstdc++, jwakely.gcc
> I don't think this patch counts as legally significant, but if you contribute again in future you should be aware of https://gcc.gnu.org/contribute.html#legal and either complete the copyright assignment paperwork, or add a DCO sign-off to the commit message.
Thanks for the reminder. I just added a sign-off.
> This should be a complete sentence, so capital letter and full stop.
Fixed!
---
Signed-off-by: Benjamin Brock <brock@cs.berkeley.edu>
libstdc++-v3/ChangeLog:
* include/std/ranges: Implement workaround for LLVM-61763 in
zip_view and adjacency_view.
---
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 1d529a886be..7893e3a84c9 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -4632,6 +4632,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
@@ -4652,11 +4655,13 @@ namespace views::__adaptor
return input_iterator_tag{};
}
+#ifndef __clang__ // LLVM-61763 workaround
template<move_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
@@ -5327,6 +5332,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>();
@@ -5367,12 +5375,14 @@ namespace views::__adaptor
friend class adjacent_view;
+#ifndef __clang__ // LLVM-61763 workaround
template<forward_range _Wp, move_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] 3+ messages in thread
* Re: [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges
2023-10-16 3:55 [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges Benjamin Acker Brock
@ 2023-10-21 11:16 ` Jonathan Wakely
2023-10-21 11:18 ` Jonathan Wakely
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2023-10-21 11:16 UTC (permalink / raw)
To: Benjamin Acker Brock; +Cc: gcc-patches, libstdc++, jwakely.gcc
On Mon, 16 Oct 2023 at 04:56, Benjamin Acker Brock <brock@berkeley.edu> wrote:
>
> > I don't think this patch counts as legally significant, but if you contribute again in future you should be aware of https://gcc.gnu.org/contribute.html#legal and either complete the copyright assignment paperwork, or add a DCO sign-off to the commit message.
>
> Thanks for the reminder. I just added a sign-off.
Thanks.
> > This should be a complete sentence, so capital letter and full stop.
>
> Fixed!
I actually adjusted the ChangeLog further, to name the modified components:
* include/std/ranges (zip_view, adjacent_view): Implement
workaround for LLVM-61763.
This is the usual convention.
Pushed to trunk now, thanks again for the fix!
> ---
>
> Signed-off-by: Benjamin Brock <brock@cs.berkeley.edu>
>
> libstdc++-v3/ChangeLog:
>
> * include/std/ranges: Implement workaround for LLVM-61763 in
> zip_view and adjacency_view.
>
> ---
>
> diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
> index 1d529a886be..7893e3a84c9 100644
> --- a/libstdc++-v3/include/std/ranges
> +++ b/libstdc++-v3/include/std/ranges
> @@ -4632,6 +4632,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
> @@ -4652,11 +4655,13 @@ namespace views::__adaptor
> return input_iterator_tag{};
> }
>
> +#ifndef __clang__ // LLVM-61763 workaround
> template<move_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
> @@ -5327,6 +5332,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>();
>
> @@ -5367,12 +5375,14 @@ namespace views::__adaptor
>
> friend class adjacent_view;
>
> +#ifndef __clang__ // LLVM-61763 workaround
> template<forward_range _Wp, move_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] 3+ messages in thread
* Re: [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges
2023-10-21 11:16 ` Jonathan Wakely
@ 2023-10-21 11:18 ` Jonathan Wakely
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2023-10-21 11:18 UTC (permalink / raw)
To: Benjamin Acker Brock; +Cc: gcc-patches, libstdc++, jwakely.gcc
On Sat, 21 Oct 2023 at 12:16, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Mon, 16 Oct 2023 at 04:56, Benjamin Acker Brock <brock@berkeley.edu> wrote:
> >
> > > I don't think this patch counts as legally significant, but if you contribute again in future you should be aware of https://gcc.gnu.org/contribute.html#legal and either complete the copyright assignment paperwork, or add a DCO sign-off to the commit message.
> >
> > Thanks for the reminder. I just added a sign-off.
>
> Thanks.
>
> > > This should be a complete sentence, so capital letter and full stop.
> >
> > Fixed!
>
> I actually adjusted the ChangeLog further, to name the modified components:
>
> * include/std/ranges (zip_view, adjacent_view): Implement
> workaround for LLVM-61763.
>
> This is the usual convention.
>
> Pushed to trunk now, thanks again for the fix!
I'll backport this to the gcc-13 branch too.
>
>
> > ---
> >
> > Signed-off-by: Benjamin Brock <brock@cs.berkeley.edu>
> >
> > libstdc++-v3/ChangeLog:
> >
> > * include/std/ranges: Implement workaround for LLVM-61763 in
> > zip_view and adjacency_view.
> >
> > ---
> >
> > diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
> > index 1d529a886be..7893e3a84c9 100644
> > --- a/libstdc++-v3/include/std/ranges
> > +++ b/libstdc++-v3/include/std/ranges
> > @@ -4632,6 +4632,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
> > @@ -4652,11 +4655,13 @@ namespace views::__adaptor
> > return input_iterator_tag{};
> > }
> >
> > +#ifndef __clang__ // LLVM-61763 workaround
> > template<move_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
> > @@ -5327,6 +5332,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>();
> >
> > @@ -5367,12 +5375,14 @@ namespace views::__adaptor
> >
> > friend class adjacent_view;
> >
> > +#ifndef __clang__ // LLVM-61763 workaround
> > template<forward_range _Wp, move_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] 3+ messages in thread
end of thread, other threads:[~2023-10-21 11:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 3:55 [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges Benjamin Acker Brock
2023-10-21 11:16 ` Jonathan Wakely
2023-10-21 11:18 ` 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).