// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s
voidt1(void){int array[1]={0};char subscript =0;int val = array[subscript];// expected-warning{{array subscript is of type 'char'}}
}voidt2(void){int array[1]={0};char subscript =0;int val = subscript[array];// expected-warning{{array subscript is of type 'char'}}
}voidt3(void){int*array =0;char subscript =0;int val = array[subscript];// expected-warning{{array subscript is of type 'char'}}
}voidt4(void){int*array =0;char subscript =0;int val = subscript[array];// expected-warning{{array subscript is of type 'char'}}
}charreturnsChar(void);voidt5(void){int*array =0;int val = array[returnsChar()];// expected-warning{{array subscript is of type 'char'}}
}voidt6(void){int array[1]={0};signedchar subscript =0;int val = array[subscript];// no warning for explicit signed char
}voidt7(void){int array[1]={0};unsignedchar subscript =0;int val = array[subscript];// no warning for unsigned char
}typedefcharCharTy;voidt8(void){int array[1]={0};
CharTy subscript =0;int val = array[subscript];// expected-warning{{array subscript is of type 'char'}}
}typedefsignedcharSignedCharTy;voidt9(void){int array[1]={0};
SignedCharTy subscript =0;int val = array[subscript];// no warning for explicit signed char
}typedefunsignedcharUnsignedCharTy;voidt10(void){int array[1]={0};
UnsignedCharTy subscript =0;int val = array[subscript];// no warning for unsigned char
}