c++: Fix implicit friend operator==.
authorJason Merrill <jason@redhat.com>
Tue, 11 Feb 2020 11:04:37 +0000 (12:04 +0100)
committerJason Merrill <jason@redhat.com>
Wed, 12 Feb 2020 00:07:41 +0000 (01:07 +0100)
commitd6ef77e023cfe0bb3b12b88ae46b77da356d7f85
treea70bf6c80ef0ce4f40fb73e7428ec56e9d3d80b7
parent9a5338e57db1cda13fa788b0e0debbcf99a475d6
c++: Fix implicit friend operator==.

It seems that in writing testcases for the operator<=> proposal I didn't
include any tests for implicitly declared friend operator==, and
consequently it didn't work.

2020-02-11  Jason Merrill  <jason@redhat.com>

PR c++/93675
* class.c (add_implicitly_declared_members): Use do_friend.
* method.c (implicitly_declare_fn): Fix friend handling.
(decl_remember_implicit_trigger_p): New.
(synthesize_method): Use it.
* decl2.c (mark_used): Use it.
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/method.c
gcc/testsuite/g++.dg/cpp2a/spaceship-synth2a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/spaceship-synth2b.C [new file with mode: 0644]