Debian Codegraph @

gcc/testsuite/g++.dg/warn/pr98104.C

raw
1 // PR c++/98104
2
3 #include <new>
4
5 struct B
6 {
7 B ();
8 int *a;
9 char b;
10 };
11
12 struct D : public B {};
13 void bar (B *);
14
15 void
16 foo ()
17 {
18 D d;
19 bar (::new (static_cast<B*>(&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]*'" }
20 }