Static templates bad; instantiations good

Chip Salzenberg chip@valinux.com
Thu May 18 17:36:00 GMT 2000


These patches fix some undefined external refs in libstdc++.so.

(I'm still getting an ICE when compiling libstdc++ with the current
CVS compiler; I have to compile misc-inst.cc with -O1 to avoid it.)

===================================================================

2000-05-18  Chip Salzenberg  <chip@valinux.com>

	* bits/ostream.tcc (_S_pad_char): Function template should not be
	static.
	* bits/streambuf.tcc (_S_copy_streambufs): Likewise.
	* src/string-inst.cc (__destroy_aux): Instantiate for string*.

Index: bits/ostream.tcc
RCS file: /cvs/gcc/egcs/libstdc++-v3/bits/ostream.tcc,v
retrieving revision 1.1
diff -u -2 -r1.1 ostream.tcc
--- ostream.tcc	2000/04/21 20:33:28	1.1
+++ ostream.tcc	2000/05/19 00:30:46
@@ -408,5 +408,5 @@
   // __news is allocated for __newlen size
   template<typename _CharT, typename _Traits>
-    static void
+    void
     _S_pad_char(basic_ios<_CharT, _Traits>& __ios, 
 		_CharT* __news, const _CharT* __olds,

Index: bits/streambuf.tcc
RCS file: /cvs/gcc/egcs/libstdc++-v3/bits/streambuf.tcc,v
retrieving revision 1.3
diff -u -2 -r1.3 streambuf.tcc
--- streambuf.tcc	2000/05/09 07:19:14	1.3
+++ streambuf.tcc	2000/05/19 00:30:46
@@ -212,5 +212,5 @@
   // necessary.
   template<typename _CharT, typename _Traits>
-    static streamsize
+    streamsize
     _S_copy_streambufs(basic_ios<_CharT, _Traits>& __ios,
 		       basic_streambuf<_CharT, _Traits>* __sbin,

Index: src/string-inst.cc
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.3
diff -u -2 -r1.3 string-inst.cc
--- string-inst.cc	2000/05/15 06:38:55	1.3
+++ string-inst.cc	2000/05/19 00:30:46
@@ -64,4 +64,5 @@
   template S::_Rep* S::_Rep::_S_create(size_t, S::allocator_type const&);
   template void S::_Rep::_M_destroy(S::allocator_type const&) throw();
+  template void __destroy_aux(S *, S *, __false_type);
 #endif
 


-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K


More information about the Libstdc++ mailing list