aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/extern-templates.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-29 14:38:03 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-29 14:38:03 +0000
commit483168227946f70e9dd7d12e7bf72bb1d76e0740 (patch)
treea33ec8b790f6cfb00576b74b56987903d96cf8b3 /test/SemaTemplate/extern-templates.cpp
parent9e17cc6abb5d55bd776d379b20d5b476bcc46c71 (diff)
Slightly improve the semantics of extern templates for member functions of class templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/extern-templates.cpp')
-rw-r--r--test/SemaTemplate/extern-templates.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/SemaTemplate/extern-templates.cpp b/test/SemaTemplate/extern-templates.cpp
index 458957033e..6bdf283391 100644
--- a/test/SemaTemplate/extern-templates.cpp
+++ b/test/SemaTemplate/extern-templates.cpp
@@ -39,3 +39,29 @@ void test_longptr(X0<long*> xl, X0<long*>::Inner xli) {
}
template class X0<long*>;
+
+template<typename T>
+class X1 {
+public:
+ void f(T t) { t += 2; }
+
+ void g(T t);
+};
+
+template<typename T>
+void X1<T>::g(T t) {
+ t += 2;
+}
+
+extern template class X1<void*>;
+
+void g_X1(X1<void*> x1, void *ptr) {
+ x1.g(ptr);
+}
+
+extern template void X1<const void*>::g(const void*);
+
+void g_X1_2(X1<const void *> x1, const void *ptr) {
+ // FIXME: This should not instantiate of x1<const void*>::g
+// x1.g(ptr);
+}