c++: using operator= [PR105223]
authorJason Merrill <jason@redhat.com>
Mon, 11 Apr 2022 21:51:43 +0000 (17:51 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 03:57:08 +0000 (23:57 -0400)
commit4195fced8a13422db94e179404588d9d887a036a
tree3a085b55cd3c7d23637e6309b41fbd4433bc48c5
parent6afb21b824dabf17c79e7b0a4230572f091307ec
c++: using operator= [PR105223]

In a template class A we normally add an implicit using A::operator= as a
placeholder for the implicitly declared operator whose signature we don't
know yet.  In my patch for PR92918 I stopped doing that if the class has an
explicit operator=, but that was wrong; an operator= taking an unrelated
type doesn't prevent the implicit declaration.

When I was working on that patch, the change was necessary to avoid another
regression, but apparently it is no longer needed.

PR c++/105223
PR c++/92918

gcc/cp/ChangeLog:

* class.cc (finish_struct): Always using op=.

gcc/testsuite/ChangeLog:

* g++.dg/template/using31.C: New test.
gcc/cp/class.cc
gcc/testsuite/g++.dg/template/using31.C [new file with mode: 0644]