blob: af01a10042dd8b1ed70e6290db4f606dd6c00132 [file] [log] [blame]
Eli Friedman5d39dee2009-06-27 05:59:59 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3// Make sure we accept this
4template<class X>struct A{typedef X Y;};
5template<class X>bool operator==(A<X>,typename A<X>::Y);
6int a(A<int> x) { return operator==(x,1); }
7
Douglas Gregor364e0212009-06-27 21:05:07 +00008int a0(A<int> x) { return x == 1; }
9
Douglas Gregorcca9e962009-07-01 22:01:06 +000010// FIXME: the location information for the note isn't very good
Eli Friedman5d39dee2009-06-27 05:59:59 +000011template<class X>struct B{typedef X Y;};
12template<class X>bool operator==(B<X>*,typename B<X>::Y); // \
13expected-error{{overloaded 'operator==' must have at least one parameter of class or enumeration type}} \
Douglas Gregorcad84b72009-11-13 23:14:53 +000014expected-note{{in instantiation of function template specialization}}
15int a(B<int> x) {
16 return operator==(&x,1); // expected-error{{no matching function}}
17}
Eli Friedman5d39dee2009-06-27 05:59:59 +000018