Debian Codegraph @

gcc/testsuite/g++.dg/warn/Warray-bounds-14.C

raw
1 /* PR middle-end/97595 - bogus -Wstringop-overflow due to DECL_SIZE_UNIT
2 underreporting field size
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
5
6 struct A { char a[32]; };
7 struct B: virtual A { };
8 struct C: B { };
9
10 struct D
11 {
12 B &b;
13 D (B&);
14 };
15
16 D::D (B &b): b (b) { } // { dg-bogus "-Warray-bounds" }
17
18 void f (void*);
19
20 void g ()
21 {
22 C c;
23 D d (c);
24 f (&d);
25 }