diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-25 15:42:11 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-25 15:42:11 +0000 |
commit | 479be1af979367d64963afb35c3547f6edad9c83 (patch) | |
tree | 8e462f2367ca6fd47fc2135893b498965a834c30 /test/SemaTemplate/instantiate-function-params.cpp | |
parent | 2b0749a4f8965d0205bf77322db150c13c39e3be (diff) |
Add another test for weird substitutions into function types during template argument deduction
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-function-params.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-function-params.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-function-params.cpp b/test/SemaTemplate/instantiate-function-params.cpp index dfba14a97c..14c4d9f933 100644 --- a/test/SemaTemplate/instantiate-function-params.cpp +++ b/test/SemaTemplate/instantiate-function-params.cpp @@ -42,3 +42,16 @@ void instF0(X0<T(A1)> x0a, X0<T(A2)> x0b) { } template void instF0<int, int, float>(X0<int(int)>, X0<int(float)>); + +template<typename R, typename A1, R (*ptr)(A1)> struct FuncPtr { }; +template<typename A1, int (*ptr)(A1)> struct FuncPtr<int, A1, ptr> { }; + +template<typename R, typename A1> R unary_func(A1); + +template<typename R, typename A1, typename A2> +void use_func_ptr() { + FuncPtr<R, A1, &unary_func<R, A1> > fp1; + FuncPtr<R, A2, &unary_func<R, A2> > fp2; +}; + +template void use_func_ptr<int, float, double>(); |