Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s |
Sebastian Redl | 759986e | 2009-10-17 20:50:27 +0000 | [diff] [blame] | 2 | template <typename T> void f(T) {} |
Anders Carlsson | 96ad533 | 2009-10-21 17:16:23 +0000 | [diff] [blame] | 3 | template <typename T> void f() { } |
Sebastian Redl | 759986e | 2009-10-17 20:50:27 +0000 | [diff] [blame] | 4 | |
| 5 | void test() { |
Sebastian Redl | 759986e | 2009-10-17 20:50:27 +0000 | [diff] [blame] | 6 | // CHECK: @_Z1fIiEvT_ |
| 7 | void (*p)(int) = &f; |
Anders Carlsson | 96ad533 | 2009-10-21 17:16:23 +0000 | [diff] [blame] | 8 | |
| 9 | // CHECK: @_Z1fIiEvv |
| 10 | void (*p2)() = f<int>; |
Sebastian Redl | 759986e | 2009-10-17 20:50:27 +0000 | [diff] [blame] | 11 | } |
Sebastian Redl | 07ab202 | 2009-10-17 21:12:09 +0000 | [diff] [blame] | 12 | // CHECK: define linkonce_odr void @_Z1fIiEvT_ |
Anders Carlsson | 96ad533 | 2009-10-21 17:16:23 +0000 | [diff] [blame] | 13 | // CHECK: define linkonce_odr void @_Z1fIiEvv |
Douglas Gregor | ad4e02f | 2010-04-29 18:24:40 +0000 | [diff] [blame] | 14 | |
| 15 | namespace 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 | } |