]> 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:19 +0000 (22:41 -0500)
commit67ac78caf31f7cb3202177e6428a46d829b70f23
tree85c13c7647c15db2a144dee1ad9e20b29acb0e58
parent254b619c566bab370da1df8317ef230aab7fd375
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]