Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Douglas Gregor | 014e88d | 2009-11-03 23:16:33 +0000 | [diff] [blame] | 3 | |
| 4 | template<typename T> |
| 5 | struct A { |
| 6 | template<typename U> A<T> operator+(U); |
| 7 | }; |
| 8 | |
| 9 | template<int Value, typename T> bool operator==(A<T>, A<T>); |
| 10 | |
| 11 | template<> bool operator==<0>(A<int>, A<int>); |
| 12 | |
| 13 | bool test_qualified_id(A<int> ai) { |
| 14 | return ::operator==<0, int>(ai, ai); |
| 15 | } |
| 16 | |
| 17 | void test_op(A<int> a, int i) { |
| 18 | const A<int> &air = a.operator+<int>(i); |
| 19 | } |
| 20 | |
| 21 | template<typename T> |
| 22 | void test_op_template(A<T> at, T x) { |
Douglas Gregor | ca1bdd7 | 2009-11-04 00:56:37 +0000 | [diff] [blame] | 23 | const A<T> &atr = at.template operator+<T>(x); |
| 24 | const A<T> &atr2 = at.A::template operator+<T>(x); |
| 25 | // FIXME: unrelated template-name instantiation issue |
| 26 | // const A<T> &atr3 = at.template A<T>::template operator+<T>(x); |
Douglas Gregor | 014e88d | 2009-11-03 23:16:33 +0000 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | template void test_op_template<float>(A<float>, float); |