]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: non-dep cmp op rewritten from <=> returning int [PR121779]
authorPatrick Palka <ppalka@redhat.com>
Tue, 9 Sep 2025 18:39:57 +0000 (14:39 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 9 Sep 2025 18:39:57 +0000 (14:39 -0400)
commitf2fddc4b84a843d32399fe457acabb73fca9869b
tree2a937b9952cd621a0fb12abe5ad1e08a5279aa23
parent7bc2e311688ac279f1abc2a47944e5b763f7ec89
c++: non-dep cmp op rewritten from <=> returning int [PR121779]

Apparently an explicitly defined operator<=> isn't required to return
std::foo_ordering, so build_min_non_dep_op_overload needs to be able
to rebuild forms of (x <=> y) @ 0 where the @ resolved to a built-in and
in turn isn't expressed as a function call.

PR c++/121779

gcc/cp/ChangeLog:

* tree.cc (build_min_non_dep_op_overload): Handle comparison
operator expressions rewritten from a <=> that returns a
non-class type.

gcc/testsuite/ChangeLog:

* g++.dg/lookup/operator-8.C: Remove outdated comment about
this test failing.
* g++.dg/lookup/operator-8a.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/tree.cc
gcc/testsuite/g++.dg/lookup/operator-8.C
gcc/testsuite/g++.dg/lookup/operator-8a.C [new file with mode: 0644]