This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing explicit instantiations in libstdc++ (was Re: Unreviewed


> > The V3 tests that instantiate types from the library that are
> > not preinstantiated should contains *explicit* instantiations so
> > that the tests work the same on targets without weak symbols.
> 
> Ok. All of the facet-named tests in 22_locale will have this problem, as 
> the testsuite makes sure that non-standard types can be instantiated for 
> all the standard facets, as a quality-of-implementation thing. 
> 
> Now that I think about it, for other reasons besides weak linking semantics, 
> these should just be compile tests, not compile-linkage-execute 
> tests.
> 
> I'll do the changes, thanks for sticking with this.

As of last night, I had the following patch which reduced the number
of testsuite failures on hppa2.0w-hp-hpux11.11 to four.  The remaining
failures are:

18_support/numeric_limits.cc:  I haven't figured out how to instantiate
std::numeric_limits<B>.

21_strings/capacity.cc: ICE in emit_move_insn_1, at expr.c:3066.

22_locale/ctype_members_char.cc: Assertion failed: _EX, file /xxx/gnu/gcc-3.1/libstdc++-v3/testsuite/22_locale/ctype_members_char.cc, line 126

ext/rope.cc: Unsatisfied symbols std::_Swap_lock_struct<0>::_S_swap_lock(data)
and std::rope<char, std::allocator<char> >::_S_min_len(data).

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-12-04  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* testsuite/22_locale/collate.cc: Provide for explicite instantiation
	of class std::basic_string<unsigned char>.
	* testsuite/22_locale/messages.cc: Likewse.
	* testsuite/22_locale/money_get.cc:
	* testsuite/22_locale/money_put.cc:
	* testsuite/22_locale/numpunct.cc:
	* testsuite/22_locale/moneypunct.cc:
	* testsuite/22_locale/num_get.cc:
	* testsuite/22_locale/num_put.cc:
	* testsuite/22_locale/numpunct_members_wchar_t.cc: Only compile and
	execute test01 if _GLIBCPP_USE_WCHAR_T is defined.
	* testsuite/26_numerics/complex_inserters_extractors.cc.orig: Provide
	for explicit instantiation of class
	std::basic_string<char, gnu_char_traits, std::allocator<char> >.

--- ./testsuite/22_locale/collate.cc.orig	Mon Dec  3 21:44:20 2001
+++ ./testsuite/22_locale/collate.cc	Mon Dec  3 23:42:53 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/messages.cc.orig	Tue Aug  7 22:49:01 2001
+++ ./testsuite/22_locale/messages.cc	Mon Dec  3 23:43:36 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/money_get.cc.orig	Thu Sep 13 19:21:25 2001
+++ ./testsuite/22_locale/money_get.cc	Mon Dec  3 23:44:07 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/money_put.cc.orig	Tue Aug 28 02:19:35 2001
+++ ./testsuite/22_locale/money_put.cc	Mon Dec  3 22:38:39 2001
@@ -22,6 +22,13 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+namespace std
+{
+  typedef basic_string<unsigned char> S;
+  template class basic_string<unsigned char>;
+}
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/numpunct.cc.orig	Wed Aug  8 16:49:34 2001
+++ ./testsuite/22_locale/numpunct.cc	Mon Dec  3 23:46:21 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/moneypunct.cc.orig	Mon Sep 10 23:40:37 2001
+++ ./testsuite/22_locale/moneypunct.cc	Mon Dec  3 23:44:50 2001
@@ -23,6 +23,9 @@
 #include <locale>
 #include <testsuite_hooks.h>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/num_get.cc.orig	Tue Nov 27 23:07:10 2001
+++ ./testsuite/22_locale/num_get.cc	Mon Dec  3 23:45:21 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/num_put.cc.orig	Tue Nov 27 23:07:10 2001
+++ ./testsuite/22_locale/num_put.cc	Mon Dec  3 23:45:50 2001
@@ -22,6 +22,9 @@
 
 #include <locale>
 
+// Provide for explicit instantiation
+template class std::basic_string<unsigned char>;
+
 void test01()
 {
   // Check for required base class.
--- ./testsuite/22_locale/numpunct_members_wchar_t.cc.orig	Tue Nov 27 23:07:10 2001
+++ ./testsuite/22_locale/numpunct_members_wchar_t.cc	Mon Dec  3 23:19:25 2001
@@ -26,6 +26,7 @@
 // XXX This test is not working for non-glibc locale models.
 // { dg-do run { xfail *-*-* } }
 
+#ifdef _GLIBCPP_USE_WCHAR_T
 void test01()
 {
   using namespace std;
@@ -79,10 +80,13 @@
   VERIFY( dp2 != dp4 );
   VERIFY( th2 != th4 );
 }
+#endif
 
 int main()
 {
+#ifdef _GLIBCPP_USE_WCHAR_T
   test01();
+#endif
 
   return 0;
 }
--- ./testsuite/26_numerics/complex_inserters_extractors.cc.orig	Wed Aug  8 16:49:37 2001
+++ ./testsuite/26_numerics/complex_inserters_extractors.cc	Mon Dec  3 23:51:26 2001
@@ -105,6 +105,8 @@
 struct gnu_char_traits : public std::char_traits<char>
 { };
 
+template class std::basic_string<char, gnu_char_traits, std::allocator<char> >;
+
 typedef std::basic_ostringstream<char, gnu_char_traits> gnu_sstream;
 
 void test02()


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]