Commit 5a4c8588 by Paolo Carlini Committed by Benjamin Kosnik

locale_facets.tcc (__pad): correctly output hex numbers internally aligned.


2001-11-28  Paolo Carlini  <pcarlini@unitus.it>

	libstdc++/3655
	* include/bits/locale_facets.tcc (__pad): correctly output hex
	numbers internally aligned.
	* testsuite/27_io/ostream_inserter_arith.cc: Add testcase.

From-SVN: r47433
parent 35a53991
2001-11-28 Paolo Carlini <pcarlini@unitus.it> 2001-11-28 Paolo Carlini <pcarlini@unitus.it>
libstdc++/3655
* include/bits/locale_facets.tcc (__pad): correctly output hex
numbers internally aligned.
* testsuite/27_io/ostream_inserter_arith.cc: Add testcase.
2001-11-28 Paolo Carlini <pcarlini@unitus.it>
Loren J. Rittle <ljrittle@acm.org> Loren J. Rittle <ljrittle@acm.org>
* include/bits/basic_string.h * include/bits/basic_string.h
......
...@@ -1959,9 +1959,9 @@ namespace std ...@@ -1959,9 +1959,9 @@ namespace std
__news[1] = __olds[1]; __news[1] = __olds[1];
__mod += 2; __mod += 2;
__news += 2; __news += 2;
__beg = const_cast<char_type*>(__olds + __mod); __beg = __pads;
__beglen = __oldlen - __mod; __beglen = __plen;
__end = __pads; __end = const_cast<char_type*>(__olds + __mod);
} }
else if (__testsign) else if (__testsign)
{ {
......
...@@ -308,11 +308,25 @@ test03() ...@@ -308,11 +308,25 @@ test03()
return 0; return 0;
} }
// libstdc++/3655
int
test04()
{
stringbuf strbuf;
ostream o(&strbuf);
o << hex << showbase << setw(6) << internal << 255;
VERIFY( strbuf.str() == "0x ff" );
return 0;
}
int int
main() main()
{ {
test01(); test01();
test02(); test02();
test04();
#ifdef TEST_NUMPUT_VERBOSE #ifdef TEST_NUMPUT_VERBOSE
cout << "Test passed!" << endl; cout << "Test passed!" << endl;
#endif #endif
......
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