summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd90fd526d31a73611bbdb34d5a5ac34c5668d507 (patch)
tree6e1f4fa6cfce2d546aa12a5c0215b92cf3552a51 /clang/test/SemaTemplate/explicit-instantiation.cpp
parentfd6aad7f1cfab3fa8a03ed2aa7fd79f09690aa12 (diff)
downloadbcm5719-llvm-d90fd526d31a73611bbdb34d5a5ac34c5668d507.tar.gz
bcm5719-llvm-d90fd526d31a73611bbdb34d5a5ac34c5668d507.zip
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. llvm-svn: 82806
Diffstat (limited to 'clang/test/SemaTemplate/explicit-instantiation.cpp')
-rw-r--r--clang/test/SemaTemplate/explicit-instantiation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/explicit-instantiation.cpp b/clang/test/SemaTemplate/explicit-instantiation.cpp
index f92c4635ccf..07994f97d3f 100644
--- a/clang/test/SemaTemplate/explicit-instantiation.cpp
+++ b/clang/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*);
OpenPOWER on IntegriCloud