1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc template<typename T> t1()4*f4a2713aSLionel Sambucvoid t1() { 5*f4a2713aSLionel Sambuc int array[1] = { 0 }; 6*f4a2713aSLionel Sambuc T subscript = 0; 7*f4a2713aSLionel Sambuc int val = array[subscript]; // expected-warning{{array subscript is of type 'char'}} 8*f4a2713aSLionel Sambuc } 9*f4a2713aSLionel Sambuc 10*f4a2713aSLionel Sambuc template<typename T> t2()11*f4a2713aSLionel Sambucvoid t2() { 12*f4a2713aSLionel Sambuc int array[1] = { 0 }; 13*f4a2713aSLionel Sambuc T subscript = 0; 14*f4a2713aSLionel Sambuc int val = subscript[array]; // expected-warning{{array subscript is of type 'char'}} 15*f4a2713aSLionel Sambuc } 16*f4a2713aSLionel Sambuc test()17*f4a2713aSLionel Sambucvoid test() { 18*f4a2713aSLionel Sambuc t1<char>(); // expected-note {{in instantiation of function template specialization 't1<char>' requested here}} 19*f4a2713aSLionel Sambuc t2<char>(); // expected-note {{in instantiation of function template specialization 't2<char>' requested here}} 20*f4a2713aSLionel Sambuc } 21*f4a2713aSLionel Sambuc 22