[Bug libstdc++/100621] ranges::reverse_view fails to meet its complexity requirements

2021-10-12 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100621

Patrick Palka  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |12.0
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Patrick Palka  ---
Fixed for GCC 12.  This probably isn't suitable for backporting to 11/10 as it
changes the layout of some specializations of reverse_view.

[Bug libstdc++/100621] ranges::reverse_view fails to meet its complexity requirements

2021-05-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100621

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:03cf8d54e5c27cfe6b184cc96757cab30d8fa1df

commit r12-855-g03cf8d54e5c27cfe6b184cc96757cab30d8fa1df
Author: Patrick Palka 
Date:   Tue May 18 00:26:25 2021 -0400

libstdc++: Fix condition for memoizing reverse_view::begin() [PR100621]

A range being a random access range isn't a sufficient condition for
ranges::next(iter, sent) to have constant time complexity -- it must
also have a sized sentinel.  This adjusts the memoization condition for
reverse_view accordingly.

libstdc++-v3/ChangeLog:

PR libstdc++/100621
* include/std/ranges (reverse_view::_S_needs_cached_begin):
Set to true if the underlying non-common random-access range
doesn't have a sized sentinel.

[Bug libstdc++/100621] ranges::reverse_view fails to meet its complexity requirements

2021-05-17 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100621

--- Comment #2 from Patrick Palka  ---
We need at least additionally check that the underlying random access range has
a sized sentinel before eliding the cache.

[Bug libstdc++/100621] ranges::reverse_view fails to meet its complexity requirements

2021-05-17 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100621

Patrick Palka  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-05-17
 CC||ppalka at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org

--- Comment #1 from Patrick Palka  ---
Confirmed.