aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/explicit-instantiation.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-25 21:45:23 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-25 21:45:23 +0000
commitdb422dffb720ff41d0b60e228f45c685600ffa9e (patch)
tree347abefb53d70d332ac3bdf0fe1097a4c69137a0 /test/SemaTemplate/explicit-instantiation.cpp
parent699a07d8a0b1579c5178b3baf4bcf9edb6b38108 (diff)
Declarators can now properly represent template-ids, e.g., for
template void f<int>(int); ~~~~~~ Previously, we silently dropped the template arguments. With this change, we now use the template arguments (when available) as the explicitly-specified template arguments used to aid template argument deduction for explicit template instantiations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/explicit-instantiation.cpp')
-rw-r--r--test/SemaTemplate/explicit-instantiation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp
index f92c4635cc..07994f97d3 100644
--- a/test/SemaTemplate/explicit-instantiation.cpp
+++ b/test/SemaTemplate/explicit-instantiation.cpp
@@ -55,3 +55,17 @@ template int X2::f0(int); // expected-error{{not an instantiation}}
template int *X2::f1(int *); // okay
template void X2::f2(int *, int *); // expected-error{{ambiguous}}
+
+
+template<typename T> void print_type();
+
+template void print_type<int>();
+template void print_type<float>();
+
+template<typename T> void print_type(T*);
+
+template void print_type(int*);
+template void print_type<int>(float*); // expected-error{{does not refer}}
+
+void print_type(double*);
+template void print_type<double>(double*);