1 /* PR middle-end/101601 - [12 Regression] -Warray-bounds triggers error:
2 arrays of functions are not meaningful
4 { dg-options "-O2 -Wall" } */
6 typedef void Fvv (void);
8 extern Fvv* pf; // { dg-message "'pf'" }
12 void test_funptr (void)
16 f (&pf + 2); // { dg-warning "subscript 2 is outside array bounds of 'void \\\(\\\* ?\\\[1]\\\)\\\(\\\)'" }
19 typedef int Fii_ (int, ...);
21 extern Fii_* pfa[3]; // { dg-message "'pfa'" }
23 void test_funptr_array (void)
29 f (pfa + 4); // { dg-warning "subscript 4 is outside array bounds of 'int \\\(\\\* ?\\\[3]\\\)\\\(int, ...\\\)'" }
34 typedef void (A::*MFvv)(void);
38 void test_memfunptr (void)
42 f (&pmf + 2); // { dg-warning "subscript 2 is outside array bounds of 'void \\\(A::\\\* ?\\\[1]\\\)\\\(\\\)'" }
46 typedef int (A::*MFii)(int);
50 void test_memfunptr_array (void)
57 f (pmfa + 5); // { dg-warning "subscript 5 is outside array bounds of 'int \\\(A::\\\* ?\\\[4]\\\)\\\(int\\\)'" }