summaryrefslogtreecommitdiffstats
path: root/clang/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
commita49cb4e4942d8b03bf9088fd43a11fc629a09c0c (patch)
treef225ddf47bb4a20c60cd7a1d4dc467a1285f5d65 /clang/test/SemaTemplate/extern-templates.cpp
parent139c3dba535d6d2050140d18e7fcab21a558cff5 (diff)
downloadbcm5719-llvm-a49cb4e4942d8b03bf9088fd43a11fc629a09c0c.tar.gz
bcm5719-llvm-a49cb4e4942d8b03bf9088fd43a11fc629a09c0c.zip
Slightly improve the semantics of extern templates for member functions of class templates
llvm-svn: 83063
Diffstat (limited to 'clang/test/SemaTemplate/extern-templates.cpp')
-rw-r--r--clang/test/SemaTemplate/extern-templates.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/extern-templates.cpp b/clang/test/SemaTemplate/extern-templates.cpp
index 458957033ef..6bdf283391f 100644
--- a/clang/test/SemaTemplate/extern-templates.cpp
+++ b/clang/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);
+}
OpenPOWER on IntegriCloud