18fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s
2*c6e68daaSAndy Gibbs // expected-no-diagnostics
33cf81317SDouglas Gregor
43cf81317SDouglas Gregor template<typename T>
53cf81317SDouglas Gregor struct A {
63cf81317SDouglas Gregor template<typename U> A<T> operator+(U);
73cf81317SDouglas Gregor };
83cf81317SDouglas Gregor
93cf81317SDouglas Gregor template<int Value, typename T> bool operator==(A<T>, A<T>);
103cf81317SDouglas Gregor
113cf81317SDouglas Gregor template<> bool operator==<0>(A<int>, A<int>);
123cf81317SDouglas Gregor
test_qualified_id(A<int> ai)133cf81317SDouglas Gregor bool test_qualified_id(A<int> ai) {
143cf81317SDouglas Gregor return ::operator==<0, int>(ai, ai);
153cf81317SDouglas Gregor }
163cf81317SDouglas Gregor
test_op(A<int> a,int i)173cf81317SDouglas Gregor void test_op(A<int> a, int i) {
183cf81317SDouglas Gregor const A<int> &air = a.operator+<int>(i);
193cf81317SDouglas Gregor }
203cf81317SDouglas Gregor
213cf81317SDouglas Gregor template<typename T>
test_op_template(A<T> at,T x)223cf81317SDouglas Gregor void test_op_template(A<T> at, T x) {
2371395fa1SDouglas Gregor const A<T> &atr = at.template operator+<T>(x);
2471395fa1SDouglas Gregor const A<T> &atr2 = at.A::template operator+<T>(x);
2571395fa1SDouglas Gregor // FIXME: unrelated template-name instantiation issue
2671395fa1SDouglas Gregor // const A<T> &atr3 = at.template A<T>::template operator+<T>(x);
273cf81317SDouglas Gregor }
283cf81317SDouglas Gregor
293cf81317SDouglas Gregor template void test_op_template<float>(A<float>, float);
30