From: Jakub Jelinek Date: Thu, 3 Dec 2020 09:02:02 +0000 (+0100) Subject: testsuite: Add testcase for already fixed PR [PR98104] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=381d1d0120e4dfab3a714f44354e868a80dbaa25;p=gcc.git testsuite: Add testcase for already fixed PR [PR98104] This testcase got broken with r11-3826 and got fixed with r11-5628. 2020-12-03 Jakub Jelinek PR c++/98104 * g++.dg/warn/pr98104.C: New test. --- diff --git a/gcc/testsuite/g++.dg/warn/pr98104.C b/gcc/testsuite/g++.dg/warn/pr98104.C new file mode 100644 index 00000000000..6ca617befe2 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/pr98104.C @@ -0,0 +1,20 @@ +// PR c++/98104 + +#include + +struct B +{ + B (); + int *a; + char b; +}; + +struct D : public B {}; +void bar (B *); + +void +foo () +{ + D d; + bar (::new (static_cast(&d)) B); // { dg-bogus "placement new constructing an object of type 'B' and size '\[0-9]*' in a region of type 'B' and size '\[0-9]*'" } +}