Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.bugs/900331_04.C

raw
1 // { dg-do run }
2 // g++ 1.37.1 bug 900331_04
3
4 // g++ is unable to correctly parse declarations of formal parameters and
5 // local objects which have pointer-to-array types or reference-to-array
6 // types.
7
8 // Cfront 2.0 passes this test.
9
10 // keywords: syntax, arrays, pointers, references, local, formal
11
12 int array[10];
13
14 int (*global_array_ptr)[10] = &array;
15 int (&global_array_ref)[10] = array;
16
17 void function0 (int (*formal_array_ptr)[10]) { // { dg-bogus "" } s
18 }
19
20 void function1 (int (&formal_array_ref)[10]) { // { dg-bogus "" } s
21 }
22
23 void function2 ()
24 {
25 int (*local_array_ptr)[10] = &array; // { dg-bogus "" } s
26 }
27
28 void function3 ()
29 {
30 int (&local_array_ref)[10] = array; // { dg-bogus "" }
31 }
32
33 int main () { return 0; }