c++: implicit operator== with previous decl [PR94583]
authorJason Merrill <jason@redhat.com>
Fri, 24 Apr 2020 20:27:26 +0000 (16:27 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 25 Apr 2020 04:17:30 +0000 (00:17 -0400)
commit352811870d7d7edcca109ef50822e26ca7ef2b36
tree10785d379f68b116876f6b29690ad2fdeb98a628
parent5e7e8b98f49eda9ffb9817d97975a211c87c5a53
c++: implicit operator== with previous decl [PR94583]

P2085 clarified that a defaulted comparison operator must be the first
declaration of the function.  Rejecting that avoids the ICE trying to
compare the noexcept-specifications.

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

PR c++/94583
* decl.c (redeclaration_error_message): Reject defaulted comparison
operator that has been previously declared.
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp2a/spaceship-synth6.C [new file with mode: 0644]