1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++23 %s
9 long &operator[](long); // expected-note{{candidate function}}
12 struct ConvertibleToInt
{
16 template<typename T
, typename U
, typename Result
>
19 Result
&result
= t
[u
]; // expected-error{{no viable overloaded operator[] for type}}
23 template struct Subscript0
<int*, int, int&>;
24 template struct Subscript0
<Sub0
, int, int&>;
25 template struct Subscript0
<Sub1
, ConvertibleToInt
, long&>;
26 template struct Subscript0
<Sub1
, Sub0
, long&>; // expected-note{{instantiation}}
31 bool operator[](int n
) const { return true; }
35 void Foo(const S
<int>& s
, T x
) {