]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: -Wdeprecated-copy and using operator= [PR92145]
authorJason Merrill <jason@redhat.com>
Fri, 23 Apr 2021 20:41:35 +0000 (16:41 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 27 Apr 2021 19:42:40 +0000 (15:42 -0400)
commit37846c42f1f5ac4d9ba190d49c4373673c89c8b5
tree821c2142813930cca7cb4b70aadd1795a1321731
parent37d2b98100cefcb9d312d379473c12aa6d61fc62
c++: -Wdeprecated-copy and using operator= [PR92145]

For the purpose of [depr.impldec] "if the class has a user-declared copy
assignment operator", an operator= brought in from a base class with 'using'
may be a copy-assignment operator, but it isn't a copy-assignment operator
for the derived class.

gcc/cp/ChangeLog:

PR c++/92145
* class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
of operator=.

gcc/testsuite/ChangeLog:

PR c++/92145
* g++.dg/cpp0x/depr-copy3.C: New test.
gcc/cp/class.c
gcc/testsuite/g++.dg/cpp0x/depr-copy3.C [new file with mode: 0644]