1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 2 // expected-no-diagnostics 3 4 // Core DR 532. 5 namespace PR8130 { 6 struct A { }; 7 8 template<class T> struct B { 9 template<class R> int &operator*(R&); 10 }; 11 12 template<class T, class R> float &operator*(T&, R&); 13 void test() { 14 A a; 15 B<A> b; 16 int &ir = b * a; 17 } 18 } 19 20 namespace OperatorWithRefQualifier { 21 struct A { }; 22 template<class T> struct B { 23 template<class R> int &operator*(R&) &&; 24 }; 25 26 template<class T, class R> float &operator*(T&&, R&); 27 void test() { 28 A a; 29 B<A> b; 30 float &ir = b * a; 31 int &ir2 = B<A>() * a; 32 } 33 } 34 35 namespace OrderWithStaticMember { 36 struct A { 37 template<class T> int g(T**, int=0) { return 0; } 38 template<class T> static int g(T*) { return 1; } 39 }; 40 void f() { 41 A a; 42 int **p; 43 a.g(p); 44 } 45 } 46