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