Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-85.c
blob0ee71200cbb837339c1e096413aeefc09883f3c4
1 /* PR middle-end/101601 - [12 Regression] -Warray-bounds triggers error:
2 arrays of functions are not meaningful
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 typedef void Fvv (void);
8 extern Fvv* pf; // { dg-message "'pf'" }
10 void f (void*);
12 void test_funptr (void)
14 f (&pf);
15 f (&pf + 1);
16 f (&pf + 2); // { dg-warning "subscript 2 is outside array bounds of 'void \\\(\\\*\\\[1]\\\)\\\(void\\\)'" }
19 typedef int Fii_ (int, ...);
21 extern Fii_* pfa[3]; // { dg-message "'pfa'" }
23 void test_funptr_array (void)
25 f (pfa);
26 f (pfa + 1);
27 f (pfa + 2);
28 f (pfa + 3);
29 f (pfa + 4); // { dg-warning "subscript 4 is outside array bounds of 'int \\\(\\\*\\\[3]\\\)\\\(int, ...\\\)'" }