summaryrefslogtreecommitdiff
path: root/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp
blob: b2a6219d04e695cbee155f31b916be076ad852e3 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clang_cc1 -fsyntax-only -verify %s

template<class T> struct A { A(); };
template<class T> int &f(T); 
template<class T> float &f(T*); 
template<class T> double &f(const T*);

template<class T> void g(T); // expected-note{{candidate}}
template<class T> void g(T&); // expected-note{{candidate}}

template<class T> int &h(const T&); 
template<class T> float &h(A<T>&);

void m() { 
  const int *p; 
  double &dr1 = f(p); 
  float x; 
  g(x); // expected-error{{ambiguous}}
  A<int> z; 
  float &fr1 = h(z);
  const A<int> z2; 
  int &ir1 = h(z2);
}