[cfe-commits] r81567 - /cfe/trunk/test/SemaTemplate/extern-templates.cpp

Douglas Gregor dgregor at apple.com
Fri Sep 11 13:35:49 PDT 2009


Author: dgregor
Date: Fri Sep 11 15:35:49 2009
New Revision: 81567

URL: http://llvm.org/viewvc/llvm-project?rev=81567&view=rev
Log:
Improve testing for extern temp templates, slightly. We are (properly) suppressing the implicit instantiation of members of extern templates

Modified:
    cfe/trunk/test/SemaTemplate/extern-templates.cpp

Modified: cfe/trunk/test/SemaTemplate/extern-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/extern-templates.cpp?rev=81567&r1=81566&r2=81567&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/extern-templates.cpp (original)
+++ cfe/trunk/test/SemaTemplate/extern-templates.cpp Fri Sep 11 15:35:49 2009
@@ -4,6 +4,10 @@
 class X0 {
 public:
   void f(T t);
+  
+  struct Inner {
+    void g(T t);
+  };
 };
 
 template<typename T>
@@ -11,10 +15,16 @@
   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);
+}





More information about the cfe-commits mailing list