]>
Commit | Line | Data |
---|---|---|
abb1b605 MS |
1 | /* PR c++/95768 - pretty-printer ICE on -Wuninitialized with allocated storage |
2 | { dg-do compile } | |
a1108556 | 3 | { dg-options "-O2 -Wall -Wno-array-bounds" } */ |
abb1b605 MS |
4 | |
5 | extern "C" void *malloc (__SIZE_TYPE__); | |
6 | ||
7 | struct f | |
8 | { | |
9 | int i; | |
10 | static int e (int); | |
11 | void operator= (int) { e (i); } | |
12 | }; | |
13 | ||
14 | struct m { | |
15 | int i; | |
16 | f length; | |
17 | }; | |
18 | ||
19 | struct n { | |
20 | m *o() { return (m *)this; } | |
21 | }; | |
22 | ||
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 | } | |
30 | }; | |
31 | ||
32 | void detach2() { p(); } |