Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / pr95768.C
blobd34d513313469faa1dd9fdfb630ad4ec91700c07
1 /* PR c++/95768 - pretty-printer ICE on -Wuninitialized with allocated storage
2    { dg-do compile }
3    { dg-options "-O2 -Wall -Wno-array-bounds" } */
5 extern "C" void *malloc (__SIZE_TYPE__);
7 struct f
9   int i;
10   static int e (int);
11   void operator= (int) { e (i); }
14 struct m {
15   int i;
16   f length;
19 struct n {
20   m *o() { return (m *)this; }
23 struct p {
24   n *header;
25   p () {
26     header = (n *)malloc (0);
27     m b = *header->o();       // { dg-warning "\\\[-Wuninitialized" }
28     b.length = 0;
29   }
32 void detach2() { p(); }