1 /* PR c/100719 - missing -Wvla-parameter on a mismatch in second parameter
3 { dg-options "-Wall" } */
5 typedef struct A1
{ int i
; } A1
;
6 typedef struct A2
{ int i
; } A2
;
7 typedef struct A3
{ int i
; } A3
;
9 extern int n
, n1
, n2
, n3
;
11 void f2 (int, A1
[n
], A2
[n
]);
12 void f2 (int, A1
[n
], A2
[n
]);
14 void f2_x1 (int, A1
[n
], A2
[n
]); // { dg-note "previously declared as 'A1\\\[n]'" }
15 void f2_x1 (int, A1
[n1
], A2
[n
]); // { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" }
17 void f2_x2 (int, A1
[n
], A2
[n
]); // { dg-note "previously declared as 'A2\\\[n]'" }
18 void f2_x2 (int, A1
[n
], A2
[n2
]); // { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" }
21 void f3 (int, A1
[n
], A2
[n
], A3
[n
]);
22 void f3 (int, A1
[n
], A2
[n
], A3
[n
]);
24 void f3_x1 (int, A1
[n
], A2
[n
], A3
[n
]);
25 // { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
26 void f3_x1 (int, A1
[n1
], A2
[n
], A3
[n
]);
27 // { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }
29 void f3_x2 (int, A1
[n
], A2
[n
], A3
[n
]);
30 // { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
31 void f3_x2 (int, A1
[n
], A2
[n2
], A3
[n
]);
32 // { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }
34 void f3_x3 (int, A1
[n
], A2
[n
], A3
[n
]);
35 // { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
36 void f3_x3 (int, A1
[n
], A2
[n
], A3
[n3
]);
37 // { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }
40 void g3_x1 (int, A1
[n
], A2
[*], A3
[n
]);
41 // { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
42 void g3_x1 (int, A1
[n1
], A2
[*], A3
[n
]);
43 // { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }
45 void g3_x2 (int, A1
[*], A2
[n
], A3
[n
]);
46 // { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
47 void g3_x2 (int, A1
[*], A2
[n2
], A3
[n
]);
48 // { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }
50 void g3_x3 (int, A1
[*], A2
[*], A3
[n
]);
51 // { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
52 void g3_x3 (int, A1
[*], A2
[*], A3
[n3
]);
53 // { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }
56 void h3_x1 (int, A1
[n
], A2
[ ], A3
[n
]);
57 // { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
58 void h3_x1 (int, A1
[n1
], A2
[ ], A3
[n
]);
59 // { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }
61 void h3_x2 (int, A1
[ ], A2
[n
], A3
[n
]);
62 // { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
63 void h3_x2 (int, A1
[ ], A2
[n2
], A3
[n
]);
64 // { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }
66 void h3_x3 (int, A1
[ ], A2
[ ], A3
[n
]);
67 // { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
68 void h3_x3 (int, A1
[ ], A2
[ ], A3
[n3
]);
69 // { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }