28 lines · cpp
1// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s2template <typename T> void f(T) {}3template <typename T> void f() { }4 5void test() {6 // CHECK: @_Z1fIiEvT_7 void (*p)(int) = &f;8 9 // CHECK: @_Z1fIiEvv10 void (*p2)() = f<int>;11}12// CHECK-LABEL: define linkonce_odr {{.*}}void @_Z1fIiEvT_13// CHECK-LABEL: define linkonce_odr {{.*}}void @_Z1fIiEvv14 15namespace PR6973 {16 template<typename T>17 struct X {18 void f(const T&);19 };20 21 template<typename T>22 int g();23 24 void h(X<int (*)()> xf) {25 xf.f(&g<int>);26 }27}28