aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-11 20:35:49 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-11 20:35:49 +0000
commit678119abd43401c8dc5480f8315b37fa093a4d21 (patch)
treec0342c9c55924f53e6891a80de5de9a3826f74a9
parent9f185076dc8b79c8240b20a8746da96beb3f147b (diff)
Improve testing for extern temp templates, slightly. We are (properly) suppressing the implicit instantiation of members of extern templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81567 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaTemplate/extern-templates.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/SemaTemplate/extern-templates.cpp b/test/SemaTemplate/extern-templates.cpp
index 3fce20c17b..3a13d11c75 100644
--- a/test/SemaTemplate/extern-templates.cpp
+++ b/test/SemaTemplate/extern-templates.cpp
@@ -4,6 +4,10 @@ template<typename T>
class X0 {
public:
void f(T t);
+
+ struct Inner {
+ void g(T t);
+ };
};
template<typename T>
@@ -11,10 +15,16 @@ void X0<T>::f(T t) {
t = 17;
}
-// FIXME: Later, we'll want to write an explicit template
-// declaration (extern template) for X0<int*>, then try to
-// call X0<int*>::f. The translation unit should succeed,
-// because we're not allowed to instantiate the out-of-line
-// definition of X0<T>::f. For now, this is just a parsing
-// test.
extern template class X0<int>;
+
+extern template class X0<int*>;
+
+template<typename T>
+void X0<T>::Inner::g(T t) {
+ t = 17;
+}
+
+void test_intptr(X0<int*> xi, X0<int*>::Inner xii) {
+ xi.f(0);
+ xii.g(0);
+}