[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2022-04-26 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #11 from Jonathan Wakely  ---
Fixed for 10.4 and 11.4 too.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2022-04-26 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #10 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:ba2baf20356befbba6c8d83bbb3676cfee7e146f

commit r10-10574-gba2baf20356befbba6c8d83bbb3676cfee7e146f
Author: Jonathan Wakely 
Date:   Mon Nov 1 11:32:39 2021 +

libstdc++: Reorder constraints on std::span::span(Range&&) constructor.

In PR libstdc++/103013 Tim Song pointed out that we could reorder the
constraints of this constructor. That's worth doing just to reduce the
work the compiler has to do during overload resolution, even if it isn't
needed to make the code in the PR work.

libstdc++-v3/ChangeLog:

* include/std/span (span(Range&&)): Reorder constraints.

(cherry picked from commit 09bc98098e4ad474d2ba9da52457b29bbd08874b)

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2022-04-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #9 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
:

https://gcc.gnu.org/g:2b0ddcec0e4cc46852e0a4dd7d00307d46233ec0

commit r11-9911-g2b0ddcec0e4cc46852e0a4dd7d00307d46233ec0
Author: Jonathan Wakely 
Date:   Mon Nov 1 11:32:39 2021 +

libstdc++: Reorder constraints on std::span::span(Range&&) constructor.

In PR libstdc++/103013 Tim Song pointed out that we could reorder the
constraints of this constructor. That's worth doing just to reduce the
work the compiler has to do during overload resolution, even if it isn't
needed to make the code in the PR work.

libstdc++-v3/ChangeLog:

* include/std/span (span(Range&&)): Reorder constraints.

(cherry picked from commit 09bc98098e4ad474d2ba9da52457b29bbd08874b)

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-11-01 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Jonathan Wakely  ---
Done.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-11-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:09bc98098e4ad474d2ba9da52457b29bbd08874b

commit r12-4833-g09bc98098e4ad474d2ba9da52457b29bbd08874b
Author: Jonathan Wakely 
Date:   Mon Nov 1 11:32:39 2021 +

libstdc++: Reorder constraints on std::span::span(Range&&) constructor.

In PR libstdc++/103013 Tim Song pointed out that we could reorder the
constraints of this constructor. That's worth doing just to reduce the
work the compiler has to do during overload resolution, even if it isn't
needed to make the code in the PR work.

libstdc++-v3/ChangeLog:

* include/std/span (span(Range&&)): Reorder constraints.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-11-01 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed||2021-11-01
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #6 from Jonathan Wakely  ---
(In reply to TC from comment #4)
> I don't think this needs an extra constraint, just reordering the existing
> ones to check not-a-span (14.3, "remove_­cvref_­t is not a specialization
> of span") first.

Good point - we should do that just because it's cheaper to evaluate the
!is_span check before we waste time determining if it's a contiguous range.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #5 from Andrey  ---
Sorry, my fault, spanhttps://eel.is/c++draft/views.span#span.overview-4. It looks strange for me,
but of course, it's not a topic for this tracker.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread rs2740 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #4 from TC  ---
I don't think this needs an extra constraint, just reordering the existing ones
to check not-a-span (14.3, "remove_­cvref_­t is not a specialization of
span") first.

But this is very much undefined anyway.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #3 from Jonathan Wakely  ---
And libstdc++ has exactly the constraints required by the C++ draft. I suggest
reporting this as an LWG defect.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #2 from Jonathan Wakely  ---
According to the standard, span is undefined behaviour, see the
last bullet of [res.on.functions].

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #1 from Andrey  ---
Sorry, the first link to godbolt in the starter message is wrong, it should be
https://gcc.godbolt.org/z/jWeqs6cM4.