[committed] libstdc++: Fix BUILTIN-PTR-CMP helpers
Jonathan Wakely
jwakely@redhat.com
Sun Feb 9 14:02:00 GMT 2020
On 09/02/20 13:56 +0000, Jonathan Wakely wrote:
>The helpers that implement BUILTIN-PTR-CMP do not currently check if the
>arguments are actually comparable, so the concept is true when it
>shouldn't be.
>
>Since we're trying to test for an unambiguous conversion to pointers, we
>can also require that it returns bool, because the built-in comparisons
>for pointers do return bool.
>
> * include/bits/range_cmp.h (__detail::__eq_builtin_ptr_cmp): Require
> equality comparison to be valid and return bool.
> (__detail::__less_builtin_ptr_cmp): Likewise for less-than comparison.
> * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Check
> type with ambiguous conversion to fundamental types.
> * testsuite/20_util/function_objects/range.cmp/less.cc: Likewise.
This fixes the new comments I added to those tests.
Tested x86_64-linux, committed to master.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1566 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20200209/2aea35b2/attachment.bin>
More information about the Libstdc++
mailing list