blob: 434d84e2b8933aab894196cd84239b5586511deb [file] [log] [blame]
Douglas Gregor3384c9c2009-05-19 00:01:19 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3
4struct Sub0 {
5 int &operator[](int);
6};
7
8struct Sub1 {
9 long &operator[](long);
10};
11
12struct ConvertibleToInt {
13 operator int();
14};
15
16template<typename T, typename U, typename Result>
17struct Subscript0 {
18 void test(T t, U u) {
19 Result &result = t[u]; // expected-error{{subscripted value is not}}
20 }
21};
22
23template struct Subscript0<int*, int, int&>;
24template struct Subscript0<Sub0, int, int&>;
25template struct Subscript0<Sub1, ConvertibleToInt, long&>;
26template struct Subscript0<Sub1, Sub0, long&>; // expected-note{{instantiation}}