libstdc++: Make std::compare_three_way check if <=> is valid (PR 93479)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 29 Jan 2020 13:36:15 +0000 (13:36 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 29 Jan 2020 13:36:15 +0000 (13:36 +0000)
commit83b0201035cfdc1d4d80153f4e19ec98cf059941
tree6fe77dada8271656dd9b3355d2593f1aa24177bd
parent5cd2e126f5c5705fa1aa7fafef3d6b94a99593da
libstdc++: Make std::compare_three_way check if <=> is valid (PR 93479)

Currently types that cannot be compared using <=> but which are
convertible to pointers will be compared by converting to pointers
first. They should not be comparable.

PR libstdc++/93479
* libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid.
* testsuite/18_support/comparisons/object/93479.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/compare
libstdc++-v3/testsuite/18_support/comparisons/object/93479.cc [new file with mode: 0644]