basic.cpp revision f670c8cfa58b4c224eb8fb566130dc47844dd3de
1// RUN: clang-cc -fsyntax-only -verify %s
2
3template<typename T> struct A { };
4
5template<typename T> A<T> f0(T*);
6
7void test_f0(int *ip, float const *cfp) {
8  A<int> a0 = f0(ip);
9  A<const float> a1 = f0(cfp);
10}
11
12template<typename T> void f1(T*, int);
13
14void test_f1(int *ip, float fv) {
15  f1(ip, fv);
16}
17
18template<typename T> void f2(T*, T*);
19
20struct ConvToIntPtr {
21  operator int*() const;
22};
23
24void test_f2(int *ip, float *fp) {
25  f2(ip, ConvToIntPtr()); // expected-error{{no matching function}}
26  f2(ip, ip); // okay
27  f2(ip, fp); // expected-error{{no matching function}}
28}
29