c++: Fix ICE with implicit operator== [PR94462]
authorJason Merrill <jason@redhat.com>
Mon, 6 Apr 2020 22:19:07 +0000 (18:19 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 7 Apr 2020 04:11:44 +0000 (00:11 -0400)
commit467fc7c83abfe8fca8b75defac7c89f6c75bf9d7
treedc9e116e3c0a14ab2658ef20cbbb2d7643a7c7ff
parent93a49d2d2292893b9b7f38132df949c70942838c
c++: Fix ICE with implicit operator== [PR94462]

duplicate_decls assumed that any TREE_ARTIFICIAL function at namespace scope
was a built-in function, but now in C++20 it's possible to have an
implicitly declared hidden friend operator==.  We just need to move the
assert into the if condition.

gcc/cp/ChangeLog
2020-04-06  Jason Merrill  <jason@redhat.com>

PR c++/94462
* decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp2a/spaceship-eq9.C [new file with mode: 0644]