2 // g++ 1.37.1 bug 900321_01
4 // cfront flags ERRORs on each of the lines indicated below. g++ does not
5 // flag either ERRORs or warnings.
7 // Although I cannot find where in the current C++ Reference Manual this
8 // topic is covered, I am sure that these statements should get ERRORs in
9 // a "strongly typed" language.
11 // Cfront 2.0 passes this test.
13 // keywords: array types, array bound, pointers
15 int (*ptr_to_array_of_ints)[];
16 int (*ptr_to_array_of_3_ints) [3];
17 int (*ptr_to_array_of_5_ints) [5];
21 // we miss the first two because typeck.c (comp_array_types) deems
22 // it okay if one of the sizes is null
23 ptr_to_array_of_ints = ptr_to_array_of_3_ints; // { dg-error "" }
24 ptr_to_array_of_3_ints = ptr_to_array_of_ints; // { dg-error "" }
26 ptr_to_array_of_3_ints = ptr_to_array_of_5_ints; // { dg-error "" }
27 ptr_to_array_of_5_ints = ptr_to_array_of_3_ints; // { dg-error "" }
30 int main () { return 0; }