brintos

brintos / llvm-project-archived public Read only

0
0
Text · 763 B · 0f5db21 Raw
37 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4template<class T> class Array { /* ... */ }; 5template<class T> void sort(Array<T>& v) { }6 7// instantiate sort(Array<int>&) - template-argument deduced8template void sort<>(Array<int>&);9 10template void sort(Array<long>&);11 12template<typename T, typename U> void f0(T, U*) { }13 14template void f0<int>(int, float*);15template void f0<>(double, float*);16 17template<typename T> struct hash { };18struct S {19  bool operator==(const S&) const { return false; }20};21 22template<typename T> struct Hash_map {23  void Method(const T& x) { h(x); }24  hash<T> h;25};26 27Hash_map<S> *x;28const Hash_map<S> *foo() {29  return x;30}31 32template<> struct hash<S> {33  int operator()(const S& k) const {34    return 0;35  }36};37