1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2
3 template<class T> class Array { /* ... */ };
sort(Array<T> & v)4 template<class T> void sort(Array<T>& v) { }
5
6 // instantiate sort(Array<int>&) - template-argument deduced
7 template void sort<>(Array<int>&);
8
9 template void sort(Array<long>&);
10
f0(T,U *)11 template<typename T, typename U> void f0(T, U*) { }
12
13 template void f0<int>(int, float*);
14 template void f0<>(double, float*);
15
16 template<typename T> struct hash { };
17 struct S {
operator ==S18 bool operator==(const S&) const { return false; }
19 };
20
21 template<typename T> struct Hash_map {
MethodHash_map22 void Method(const T& x) { h(x); }
23 hash<T> h;
24 };
25
26 Hash_map<S> *x;
foo()27 const Hash_map<S> *foo() {
28 return x;
29 }
30
31 template<> struct hash<S> {
operator ()hash32 int operator()(const S& k) const {
33 return 0;
34 }
35 };
36