blob: 99ade4bc99741410c93de96533882f3199dd7442 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
template <class T> T* f(int); // #1
template <class T, class U> T& f(U); // #2
void g() {
int *ip = f<int>(1); // calls #1
}
template<typename T>
struct identity {
typedef T type;
};
template <class T>
T* f2(int, typename identity<T>::type = 0); // expected-note{{candidate}}
template <class T, class U>
T& f2(U, typename identity<T>::type = 0); // expected-note{{candidate}}
void g2() {
f2<int>(1); // expected-error{{ambiguous}}
}
|