blob: 9a0884e8136d1654fa5f31df3c4f3b1b365592c2 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregor014e88d2009-11-03 23:16:33 +00002
3template<typename T>
4struct A {
5 template<typename U> A<T> operator+(U);
6};
7
8template<int Value, typename T> bool operator==(A<T>, A<T>);
9
10template<> bool operator==<0>(A<int>, A<int>);
11
12bool test_qualified_id(A<int> ai) {
13 return ::operator==<0, int>(ai, ai);
14}
15
16void test_op(A<int> a, int i) {
17 const A<int> &air = a.operator+<int>(i);
18}
19
20template<typename T>
21void test_op_template(A<T> at, T x) {
Douglas Gregorca1bdd72009-11-04 00:56:37 +000022 const A<T> &atr = at.template operator+<T>(x);
23 const A<T> &atr2 = at.A::template operator+<T>(x);
24 // FIXME: unrelated template-name instantiation issue
25 // const A<T> &atr3 = at.template A<T>::template operator+<T>(x);
Douglas Gregor014e88d2009-11-03 23:16:33 +000026}
27
28template void test_op_template<float>(A<float>, float);