PR c++/84850 - -Wclass-memaccess on a memcpy in a copy assignment operator with no...
authorMartin Sebor <msebor@redhat.com>
Wed, 21 Mar 2018 15:14:02 +0000 (15:14 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 21 Mar 2018 15:14:02 +0000 (09:14 -0600)
commite65fc7c572594c8c4e38edb56fd6a6eb401fd4b4
tree2fc52168e184bdb48ef7c4dadd3a4d4d7033f535
parent2a80d3ae14f6f823e28637fd28b5808a6e4aa5ba
PR c++/84850 - -Wclass-memaccess on a memcpy in a copy assignment operator with no nontrivial bases or members

gcc/cp/ChangeLog:

PR c++/84850
* call.c (first_non_public_field): New template and function.
(first_non_trivial_field): New function.
(maybe_warn_class_memaccess): Call them.

gcc/testsuite/ChangeLog:

PR c++/84850
* g++.dg/Wclass-memaccess-3.C: New test.
* g++.dg/Wclass-memaccess-4.C: New test.

From-SVN: r258719
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/Wclass-memaccess-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/Wclass-memaccess-4.C [new file with mode: 0644]