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

Paul Keir Paul.Keir@uws.ac.uk
Fri Aug 20 20:17:40 GMT 2021


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?

Thanks,
Paul


Please consider the environment and think before you print.

The University of the West of Scotland is a registered Scottish charity. Charity number SC002520.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the University of the West of Scotland.

As a public body, the University of the West of Scotland may be required to make available emails as well as other written forms of information as a result of a request made under the Freedom of Information (Scotland) Act 2002.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compare_three_way_constexpr.patch
Type: text/x-patch
Size: 2947 bytes
Desc: compare_three_way_constexpr.patch
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210820/bb18d83c/attachment-0001.bin>


More information about the Libstdc++ mailing list