PR c++/69662 - -Wplacement-new on allocated one element array members
commita7cc1f9413bc7e462eca0bd1ed30f77e5e693062
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Feb 2016 22:27:37 +0000 (5 22:27 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Feb 2016 22:27:37 +0000 (5 22:27 +0000)
tree541c8bae08fe762974822bede51ea47ee085418f
parentfcb25f28b7b0986849618f615188f7f092db3ccd
PR c++/69662 - -Wplacement-new on allocated one element array members

gcc/testsuite/ChangeLog:
PR c++/69662
* g++.dg/warn/Wplacement-new-size-1.C: New test.
* g++.dg/warn/Wplacement-new-size-2.C: New test.

gcc/cp/ChangeLog:
PR c++/69662
* init.c (find_field_init): New function.
(warn_placement_new_too_small): Call it.  Handle one-element arrays
        at ends of structures special.

gcc/c-family/ChangeLog:
PR c++/69662
* c.opt (Warning options): Update -Wplacement-new to take
        an optional argument.

gcc/ChangeLog:
PR c++/69662
* doc/invoke.texi: Update -Wplacement-new to take an optional
        argument.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233190 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/init.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wplacement-new-size-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wplacement-new-size-2.C [new file with mode: 0644]