Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.bugs/900321_05.C

raw
1 // { dg-do run }
2 // g++ 1.37.1 bug 900321_05
3
4 // The following code is legal as far as the ANSI C standard, GCC, and
5 // cfront are concerned, however g++ issues errors for the lines indicated.
6
7 // Cfront 2.0 passes this test.
8
9 // keywords: operator[], pointers, index
10
11 char c;
12 char *cp;
13 int i;
14
15 void function ()
16 {
17 c = 3["abcdef"]; // { dg-bogus "" }
18 c = i[cp]; // { dg-bogus "" }
19 }
20
21 int main () { return 0; }