Home | History | Annotate | Download | only in temp.func.order
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 template<class T> struct A { A(); };
      4 template<class T> int &f(T);
      5 template<class T> float &f(T*);
      6 template<class T> double &f(const T*);
      7 
      8 template<class T> void g(T); // expected-note{{candidate}}
      9 template<class T> void g(T&); // expected-note{{candidate}}
     10 
     11 template<class T> int &h(const T&);
     12 template<class T> float &h(A<T>&);
     13 
     14 void m() {
     15   const int *p;
     16   double &dr1 = f(p);
     17   float x;
     18   g(x); // expected-error{{ambiguous}}
     19   A<int> z;
     20   float &fr1 = h(z);
     21   const A<int> z2;
     22   int &ir1 = h(z2);
     23 }
     24