Eli Friedman | 5d39dee | 2009-06-27 05:59:59 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | // Make sure we accept this |
| 4 | template<class X>struct A{typedef X Y;}; |
| 5 | template<class X>bool operator==(A<X>,typename A<X>::Y); |
| 6 | int a(A<int> x) { return operator==(x,1); } |
| 7 | |
| 8 | // FIXME: The diagnostic here is a bit messed up |
| 9 | template<class X>struct B{typedef X Y;}; |
| 10 | template<class X>bool operator==(B<X>*,typename B<X>::Y); // \ |
| 11 | expected-error{{overloaded 'operator==' must have at least one parameter of class or enumeration type}} \ |
| 12 | expected-note{{in instantiation of default argument for 'operator==<int>' required here}} |
| 13 | int a(B<int> x) { return operator==(&x,1); } |
| 14 | |