[committed] libstdc++: Add comparison operators to std::unique_ptr

Jonathan Wakely jwakely@redhat.com
Thu Apr 9 20:12:21 GMT 2020


Some more C++20 changes from P1614R2, "The Mothership has Landed".

This includes the proposed resolution for LWG 3426 to fix the three-way
comparison with nullptr_t.

The existing tests for unique_ptr comparisons don't actually check the
results, only that the expressions compile and are convertible to bool.
This also adds a test for the results of those comparisons for C++11 and
up.

         * include/bits/unique_ptr.h (operator<=>): Define for C++20.
         * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line.
         * testsuite/20_util/default_delete/void_neg.cc: Likewise.
         * testsuite/20_util/unique_ptr/comparison/compare.cc: New test.
         * testsuite/20_util/unique_ptr/comparison/compare_c++20.cc: New test.

Tested powerpc64le-linux, committed to master.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 9702 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20200409/49791b60/attachment.bin>


More information about the Libstdc++ mailing list