Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / Warray-bounds-15.C
blob455f3a0c300aada9fa94c23b3db371d41244a5c4
1 /* PR middle-end/98266 - bogus array subscript is partly outside array
2    bounds on virtual inheritance
3    { dg-do compile }
4    { dg-options "-O2 -Wall" } */
6 #if __cplusplus < 201103L
7 // This matters for the test case.
8 #  define noexcept   throw ()
9 #endif
11 struct A
13   virtual ~A () noexcept;
14   const char *s;
17 struct B: virtual A { };
18 struct C: virtual A { };      // { dg-bogus "\\\[-Warray-bounds" }
20 struct D: virtual B, virtual C
22   D (const char*);
25 void sink (void*);
26 void sink (D);
29 // Verify that accesses to the table aren't diagnosed.
30 void test_vtbl ()
32   sink (D (""));