1 // PR c++/71306 - bogus -Wplacement-new with an array element
3 // { dg-options "-Wplacement-new" }
5 void* operator new (__SIZE_TYPE__, void *p) { return p; }
7 struct S64 { char c [64]; };
17 char a [2][sizeof (S64)];
23 // Verify there is no warning with buffers of sufficient size.
27 // ..and no warning with pointers to buffers of unknown size.
31 // But a warning when using the ps2_2 array itself as opposed
32 // to the pointers it's elements might point to.
33 new (ps2_2 [0]) S64; // { dg-warning "placement new" }
34 new (ps2_2 [1]) S64; // { dg-warning "placement new" }
36 // ..and no warning again with pointers to buffers of unknown