PR c++/81327
commit4b97404d90d20fe5dbb3659cf4ae9a71bc9ba728
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 16:59:09 +0000 (10 16:59 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 16:59:09 +0000 (10 16:59 +0000)
tree4215141484dca32b97d1741887ba59b0ce723562
parent0d30cca1e881ae2692628385e89fe485400ea910
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 *.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256440 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/Wclass-memaccess-2.C