1 // RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s
6 int val
= array
[subscript
]; // expected-warning{{array subscript is of type 'char'}}
12 int val
= subscript
[array
]; // expected-warning{{array subscript is of type 'char'}}
18 int val
= array
[subscript
]; // expected-warning{{array subscript is of type 'char'}}
24 int val
= subscript
[array
]; // expected-warning{{array subscript is of type 'char'}}
27 char returnsChar(void);
30 int val
= array
[returnsChar()]; // expected-warning{{array subscript is of type 'char'}}
35 signed char subscript
= 0;
36 int val
= array
[subscript
]; // no warning for explicit signed char
41 unsigned char subscript
= 0;
42 int val
= array
[subscript
]; // no warning for unsigned char
49 int val
= array
[subscript
]; // expected-warning{{array subscript is of type 'char'}}
52 typedef signed char SignedCharTy
;
55 SignedCharTy subscript
= 0;
56 int val
= array
[subscript
]; // no warning for explicit signed char
59 typedef unsigned char UnsignedCharTy
;
62 UnsignedCharTy subscript
= 0;
63 int val
= array
[subscript
]; // no warning for unsigned char