[PATCH] libstdc++: Fix comparison operators in elements and chunk views
Jonathan Wakely
jwakely.gcc@gmail.com
Fri Dec 4 07:38:40 GMT 2026
On Fri, 4 Dec 2026, 02:15 Waffl3x, <waffl3x@protonmail.com> wrote:
> I also eyeballed the rest of the views that conditionally use
> operator<=>, the rest seem fine. I suspect the test case I added is not
> satisfactory. In particular, it is not enabled for C++20 mode but I did
> not feel like making 2 different cases when I don't know where they
> should be placed.
>
If it's going to live in std/ranges/adaptors then it should really test all
adaptors, not just two.
They're no need for two tests though, just enable it for C++20 not C++23
and use the feature test macro to check which views exist in the current
compilation.
> I specifically made a dummy iterator to disable the views iterator's
> operator<=>. At a glance, it seems like the iterators in
> testsuite_iterators.h might be suitable for that purpose. However, I
> wasn't sure and wanted a testcase I can be sure tests what I needed it
> to test for now. If preferred, I'll fix the testcase to use
> testsuite_iterators.h instead.
>
In the new test we don't want the no_pch option.
The test iterator isn't a valid Cpp17 random access iterator as it doesn't
return a reference, so its category lies. Can it use the int member as an
index into a global array so that operator* returns a reference?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20261204/d598ef79/attachment.htm>
More information about the Libstdc++
mailing list