Commit 0d223e3a by Benjamin Kosnik Committed by Benjamin Kosnik

std_iomanip.h: Inline, tweaks.


2002-02-19  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/std_iomanip.h: Inline, tweaks.
	* config/linker-map.gnu: Remove hacks.

	* testsuite/21_strings/capacity.cc: Add explicit instantiations.
	* testsuite/27_io/ios_init.cc: Same.
	* testsuite/22_locale/money_get_members_char.cc (test07): Fix.
	* testsuite/22_locale/money_get_members_wchar_t.cc (test07): Same.

From-SVN: r49884
parent ae34ac46
2002-02-19 Benjamin Kosnik <bkoz@redhat.com> 2002-02-19 Benjamin Kosnik <bkoz@redhat.com>
* include/std/std_iomanip.h: Inline, tweaks.
* config/linker-map.gnu: Remove hacks.
* testsuite/21_strings/capacity.cc: Add explicit instantiations.
* testsuite/27_io/ios_init.cc: Same.
* testsuite/22_locale/money_get_members_char.cc (test07): Fix.
* testsuite/22_locale/money_get_members_wchar_t.cc (test07): Same.
2002-02-19 Benjamin Kosnik <bkoz@redhat.com>
* config/linker-map.gnu: Export global vtable, typeinfo, guard * config/linker-map.gnu: Export global vtable, typeinfo, guard
variable, and thunk info as per CXXABI docs. variable, and thunk info as per CXXABI docs.
......
...@@ -25,8 +25,8 @@ GLIBCPP_3.1 { ...@@ -25,8 +25,8 @@ GLIBCPP_3.1 {
global: global:
## Names inside the 'extern' block are demangled names. # Names inside the 'extern' block are demangled names.
## All but the last are terminated with a semicolon. # All but the last are terminated with a semicolon.
extern "C++" extern "C++"
{ {
std::[A-Za-z]*; std::[A-Za-z]*;
...@@ -36,17 +36,17 @@ GLIBCPP_3.1 { ...@@ -36,17 +36,17 @@ GLIBCPP_3.1 {
std::__timepunct* std::__timepunct*
}; };
## Names not in an 'extern' block are mangled names. # Names not in an 'extern' block are mangled names.
## operator new(unsigned) # operator new(unsigned)
_Znwj; _Znwj;
## operator delete(void*) # operator delete(void*)
_ZdlPv; _ZdlPv;
## operator new[](unsigned) # operator new[](unsigned)
_Znaj; _Znaj;
## operator delete[](void*) # operator delete[](void*)
_ZdaPv; _ZdaPv;
# vtable # vtable
...@@ -65,41 +65,26 @@ GLIBCPP_3.1 { ...@@ -65,41 +65,26 @@ GLIBCPP_3.1 {
_ZTv*; _ZTv*;
_ZTc*; _ZTc*;
# XXX # libsupc++
__cxa_*; __cxa_*;
__gxx_personality_v0; __gxx_personality_v0;
__dynamic_cast; __dynamic_cast;
## std::_S_rb_tree_red # std::_S_rb_tree_red
_ZSt14_S_rb_tree_red; _ZSt14_S_rb_tree_red;
## std::_S_rb_tree_black # std::_S_rb_tree_black
_ZSt16_S_rb_tree_black; _ZSt16_S_rb_tree_black;
## std::__stl_threshold # std::__stl_threshold
_ZSt15__stl_threshold; _ZSt15__stl_threshold;
## std::__stl_chunk_size # std::__stl_chunk_size
_ZSt16__stl_chunk_size; _ZSt16__stl_chunk_size;
# this is a function, "void std::__convert_to_v(stuff)", and as such # std::__convert_to_v
# doesn't work well in the demangled section above
_ZSt14__convert_to_v*; _ZSt14__convert_to_v*;
# likewise for "std::_Setfill<char> std::setfill<char>(char)"
_ZSt7setfillIcESt8_SetfillIT_ES1_;
# likewise for "bool std::has_facet<std::ctype<char> >(std::locale const&)"
_ZSt9has_facetISt5ctypeIcEEbRKSt6locale;
# likewise for "bool
# std::has_facet<std::num_put<char, std::ostreambuf_iterator<char,
# std::char_traits<char> > > >(std::locale const&)"
_ZSt9has_facetISt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEEbRKSt6locale;
# ditto for istreambuf_iterator
_ZSt9has_facetISt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEEbRKSt6locale;
local: local:
*; *;
}; };
...@@ -57,16 +57,16 @@ namespace std ...@@ -57,16 +57,16 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f)
{ {
__is.setf(ios_base::fmtflags(0), __f._M_mask); __is.setf(ios_base::fmtflags(0), __f._M_mask);
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f)
{ {
__os.setf(ios_base::fmtflags(0), __f._M_mask); __os.setf(ios_base::fmtflags(0), __f._M_mask);
...@@ -84,16 +84,16 @@ namespace std ...@@ -84,16 +84,16 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f)
{ {
__is.setf(__f._M_mask); __is.setf(__f._M_mask);
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f)
{ {
__os.setf(__f._M_mask); __os.setf(__f._M_mask);
...@@ -111,8 +111,8 @@ namespace std ...@@ -111,8 +111,8 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f)
{ {
__is.setf(__f._M_base == 8 ? ios_base::oct : __is.setf(__f._M_base == 8 ? ios_base::oct :
...@@ -122,8 +122,8 @@ namespace std ...@@ -122,8 +122,8 @@ namespace std
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f)
{ {
__os.setf(__f._M_base == 8 ? ios_base::oct : __os.setf(__f._M_base == 8 ? ios_base::oct :
...@@ -134,11 +134,11 @@ namespace std ...@@ -134,11 +134,11 @@ namespace std
} }
template<class _CharT> template<typename _CharT>
struct _Setfill { _CharT _M_c; }; struct _Setfill { _CharT _M_c; };
template<class _CharT> template<typename _CharT>
_Setfill<_CharT> inline _Setfill<_CharT>
setfill(_CharT __c) setfill(_CharT __c)
{ {
_Setfill<_CharT> __x; _Setfill<_CharT> __x;
...@@ -146,16 +146,16 @@ namespace std ...@@ -146,16 +146,16 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f)
{ {
__is.fill(__f._M_c); __is.fill(__f._M_c);
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f)
{ {
__os.fill(__f._M_c); __os.fill(__f._M_c);
...@@ -173,16 +173,16 @@ namespace std ...@@ -173,16 +173,16 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f)
{ {
__is.precision(__f._M_n); __is.precision(__f._M_n);
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f)
{ {
__os.precision(__f._M_n); __os.precision(__f._M_n);
...@@ -200,16 +200,16 @@ namespace std ...@@ -200,16 +200,16 @@ namespace std
return __x; return __x;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>& inline basic_istream<_CharT,_Traits>&
operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f)
{ {
__is.width(__f._M_n); __is.width(__f._M_n);
return __is; return __is;
} }
template <class _CharT, class _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT,_Traits>& inline basic_ostream<_CharT,_Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f) operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f)
{ {
__os.width(__f._M_n); __os.width(__f._M_n);
......
...@@ -29,11 +29,11 @@ template<typename T> ...@@ -29,11 +29,11 @@ template<typename T>
template<typename T> template<typename T>
bool bool
operator==(const A<T>& a, const A<T>& b) { } operator==(const A<T>& a, const A<T>& b) { return true; }
template<typename T> template<typename T>
bool bool
operator<(const A<T>& a, const A<T>& b) { } operator<(const A<T>& a, const A<T>& b) { return true; }
struct B { }; struct B { };
...@@ -188,6 +188,14 @@ bool test02() ...@@ -188,6 +188,14 @@ bool test02()
return test; return test;
} }
// Explicitly instantiate for systems with no COMDAT or weak support.
template
std::basic_string< A<B> >::size_type
std::basic_string< A<B> >::_Rep::_S_max_size;
template
A<B>
std::basic_string< A<B> >::_Rep::_S_terminal;
int main() int main()
{ {
...@@ -196,3 +204,7 @@ int main() ...@@ -196,3 +204,7 @@ int main()
return 0; return 0;
} }
...@@ -352,13 +352,13 @@ struct My_money_io : public std::moneypunct<char,false> ...@@ -352,13 +352,13 @@ struct My_money_io : public std::moneypunct<char,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { symbol, none, sign, value } }; pattern pat = { { symbol, none, sign, value } };
return pat; return pat;
} }
pattern do_neg_format() const pattern do_neg_format() const
{ {
static pattern pat = { { symbol, none, sign, value } }; pattern pat = { { symbol, none, sign, value } };
return pat; return pat;
} }
}; };
...@@ -369,6 +369,8 @@ void test05() ...@@ -369,6 +369,8 @@ void test05()
using namespace std; using namespace std;
typedef istreambuf_iterator<char> InIt; typedef istreambuf_iterator<char> InIt;
bool test = true;
locale loc(locale::classic(), new My_money_io); locale loc(locale::classic(), new My_money_io);
string bufferp("$1234.56"); string bufferp("$1234.56");
...@@ -416,6 +418,7 @@ void test05() ...@@ -416,6 +418,7 @@ void test05()
void test06() void test06()
{ {
using namespace std; using namespace std;
bool test = true;
typedef istreambuf_iterator<char> InIt; typedef istreambuf_iterator<char> InIt;
InIt iend1, iend2, iend3; InIt iend1, iend2, iend3;
...@@ -461,7 +464,7 @@ struct My_money_io_a : public std::moneypunct<char,false> ...@@ -461,7 +464,7 @@ struct My_money_io_a : public std::moneypunct<char,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { sign, value, space, symbol } }; pattern pat = { { sign, value, space, symbol } };
return pat; return pat;
} }
}; };
...@@ -478,7 +481,7 @@ struct My_money_io_b : public std::moneypunct<char,false> ...@@ -478,7 +481,7 @@ struct My_money_io_b : public std::moneypunct<char,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { sign, value, symbol, none } }; pattern pat = { { sign, value, symbol, none } };
return pat; return pat;
} }
}; };
...@@ -493,6 +496,7 @@ void test07() ...@@ -493,6 +496,7 @@ void test07()
typedef istreambuf_iterator<char> InIt; typedef istreambuf_iterator<char> InIt;
bool intl = false; bool intl = false;
bool test = true;
ios_base::iostate err; ios_base::iostate err;
locale loc_a(locale::classic(), new My_money_io_a); locale loc_a(locale::classic(), new My_money_io_a);
......
...@@ -354,13 +354,13 @@ struct My_money_io : public std::moneypunct<wchar_t,false> ...@@ -354,13 +354,13 @@ struct My_money_io : public std::moneypunct<wchar_t,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { symbol, none, sign, value } }; pattern pat = { { symbol, none, sign, value } };
return pat; return pat;
} }
pattern do_neg_format() const pattern do_neg_format() const
{ {
static pattern pat = { { symbol, none, sign, value } }; pattern pat = { { symbol, none, sign, value } };
return pat; return pat;
} }
}; };
...@@ -369,6 +369,7 @@ struct My_money_io : public std::moneypunct<wchar_t,false> ...@@ -369,6 +369,7 @@ struct My_money_io : public std::moneypunct<wchar_t,false>
void test05() void test05()
{ {
using namespace std; using namespace std;
bool test = true;
typedef istreambuf_iterator<wchar_t> InIt; typedef istreambuf_iterator<wchar_t> InIt;
locale loc(locale::classic(), new My_money_io); locale loc(locale::classic(), new My_money_io);
...@@ -418,6 +419,7 @@ void test05() ...@@ -418,6 +419,7 @@ void test05()
void test06() void test06()
{ {
using namespace std; using namespace std;
bool test = true;
typedef istreambuf_iterator<wchar_t> InIt; typedef istreambuf_iterator<wchar_t> InIt;
InIt iend1, iend2, iend3; InIt iend1, iend2, iend3;
...@@ -463,7 +465,7 @@ struct My_money_io_a : public std::moneypunct<wchar_t,false> ...@@ -463,7 +465,7 @@ struct My_money_io_a : public std::moneypunct<wchar_t,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { sign, value, space, symbol } }; pattern pat = { { sign, value, space, symbol } };
return pat; return pat;
} }
}; };
...@@ -480,7 +482,7 @@ struct My_money_io_b : public std::moneypunct<wchar_t,false> ...@@ -480,7 +482,7 @@ struct My_money_io_b : public std::moneypunct<wchar_t,false>
pattern do_pos_format() const pattern do_pos_format() const
{ {
static pattern pat = { { sign, value, symbol, none } }; pattern pat = { { sign, value, symbol, none } };
return pat; return pat;
} }
}; };
...@@ -492,6 +494,7 @@ struct My_money_io_b : public std::moneypunct<wchar_t,false> ...@@ -492,6 +494,7 @@ struct My_money_io_b : public std::moneypunct<wchar_t,false>
void test07() void test07()
{ {
using namespace std; using namespace std;
bool test = true;
typedef istreambuf_iterator<wchar_t> InIt; typedef istreambuf_iterator<wchar_t> InIt;
bool intl = false; bool intl = false;
......
...@@ -131,6 +131,15 @@ void test02() ...@@ -131,6 +131,15 @@ void test02()
VERIFY( test ); VERIFY( test );
} }
// Explicitly instantiate for systems with no COMDAT or weak support.
template
std::basic_string<unsigned short>::size_type
std::basic_string<unsigned short>::_Rep::_S_max_size;
template
unsigned short
std::basic_string<unsigned short>::_Rep::_S_terminal;
int main() int main()
{ {
test01(); test01();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment