diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-11 20:35:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-11 20:35:49 +0000 |
commit | dd3f5f1fcabd0be8167dcd5e96fbe1e7a09ff300 (patch) | |
tree | 103d28e62eb5adcac9c5083107f91a354bce6f32 /clang/test/SemaTemplate/extern-templates.cpp | |
parent | 6411b92ee6d4ac926a7f5daa2bfd5adfcfa6b033 (diff) | |
download | bcm5719-llvm-dd3f5f1fcabd0be8167dcd5e96fbe1e7a09ff300.tar.gz bcm5719-llvm-dd3f5f1fcabd0be8167dcd5e96fbe1e7a09ff300.zip |
Improve testing for extern temp templates, slightly. We are (properly) suppressing the implicit instantiation of members of extern templates
llvm-svn: 81567
Diffstat (limited to 'clang/test/SemaTemplate/extern-templates.cpp')
-rw-r--r-- | clang/test/SemaTemplate/extern-templates.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/clang/test/SemaTemplate/extern-templates.cpp b/clang/test/SemaTemplate/extern-templates.cpp index 3fce20c17bc..3a13d11c754 100644 --- a/clang/test/SemaTemplate/extern-templates.cpp +++ b/clang/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); +} |