PR c++/67942 - diagnose placement new buffer overflow
authorMartin Sebor <msebor@redhat.com>
Fri, 6 Nov 2015 01:08:53 +0000 (01:08 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 6 Nov 2015 01:08:53 +0000 (18:08 -0700)
commit906f9ad995368b4891186c07ed3c5c2fd5f53bea
tree290722de96f765a33eafce59384bc6741c175d1a
parent925b6a76e2d352c7a59119a4179db953ad30af00
PR c++/67942 - diagnose placement new buffer overflow

gcc/cp/
* cp/init.c (warn_placement_new_too_small): Avoid assuming
the size of the first operand of placement new or its type
is known.

gcc/testsuite/
* g++.dg/warn/Wplacement-new-size.C: Exercise placement new
invocations where the size of the destination buffer object
or its type (or both) is unknown.

From-SVN: r229831
gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wplacement-new-size.C