https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81327
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Jan 10 16:59:09 2018 New Revision: 256440 URL: https://gcc.gnu.org/viewcvs?rev=256440&root=gcc&view=rev Log: PR c++/81327 * call.c (maybe_warn_class_memaccess): Add forward declaration. Change last argument from tree * to const vec<tree, va_gc> *, adjust args uses and check number of operands too. Don't strip away any nops. Use maybe_constant_value when looking for INTEGER_CST args. Deal with src argument not having pointer type. Check tree_fits_uhwi_p before calling tree_to_uhwi. Remove useless test. (build_over_call): Call maybe_warn_class_memaccess here on the original arguments. (build_cxx_call): Rather than here on converted arguments. * g++.dg/Wclass-memaccess-2.C: Don't expect a warning when explicitly cast to void *. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/Wclass-memaccess-2.C