[PATCH] libstdc++: Fix compare_three_way for constexpr and Clang

Jonathan Wakely jwakely@redhat.com
Mon Oct 11 19:48:05 GMT 2021


On Fri, 20 Aug 2021 at 21:19, Paul Keir wrote:
>
> Hi,
>
> The current compare_three_way implementation makes provision for constant evaluation contexts (avoiding reinterpret_cast etc.), but the approach fails with Clang; when it compares two const volatile void pointers: "comparison between unequal pointers to void has unspecified result". I include a fix and test.
>
> Could someone commit the attached patch for me?

Sorry for dropping the ball on this again. I've applied the patch
locally and I'm testing it now. Unless I'm mistaken, you do not have a
copyright assignment on file with the FSF, is that right? Are you able
to certify that you have the right to submit this to GCC, as described
at https://gcc.gnu.org/dco.html ?

Also, if GCC is failing to diagnose the invalid comparisons here then
that should be reported to bugzilla as a c++ "accepts-invalid" bug.



More information about the Gcc-patches mailing list