]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: defaulted op== for incomplete class [PR107291]
authorJason Merrill <jason@redhat.com>
Tue, 6 Feb 2024 00:56:45 +0000 (19:56 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 6 Feb 2024 03:41:29 +0000 (22:41 -0500)
commitdb8d5b0ad074344559b3201e567c1e47e65d0bdd
treeda3f348c5da6bd8ed4a0c3c6798398eaf344f594
parent684f174c740e0172202c4b8fe887d40d68883759
c++: defaulted op== for incomplete class [PR107291]

After complaining about lack of friendship, we should not try to go on and
define the defaulted comparison operator anyway.

PR c++/107291

gcc/cp/ChangeLog:

* method.cc (early_check_defaulted_comparison): Fail if not friend.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/spaceship-eq17.C: New test.

(cherry picked from commit c5d34912ad576be1ef19be92f7eabde54b9089eb)
gcc/cp/method.cc
gcc/testsuite/g++.dg/cpp2a/spaceship-eq17.C [new file with mode: 0644]