diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-13 09:00:31 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-13 09:00:31 +0000 |
commit | d978d656d8017e71fe4d2802766c4ceda99bccbf (patch) | |
tree | 62a5ac79c15b666f719419ef0629306a93f3a310 /libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc | |
parent | 4913f81e03720d3d25e6b2ef777a3d764d1c2f7c (diff) | |
download | gcc-d978d656d8017e71fe4d2802766c4ceda99bccbf.tar.gz |
2006-10-13 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28277 (partial: ostream bits 2)
* include/std/std_ostream.h (basic_ostream<>::_M_insert(const
char_type*, streamsize)): New.
(basic_ostream<>::_M_write(char_type, streamsize)): Likewise.
(operator<<(basic_ostream<>&, _CharT), operator<<(basic_ostream<>&,
char), operator<<(basic_ostream<>&, const _CharT*),
operator<<(basic_ostream<>&, const char*)): Use the latter.
* include/bits/ostream.tcc (basic_ostream<>::_M_insert(const
char_type*, streamsize)): Define.
(operator<<(basic_ostream<>&, const char*)): Use the latter.
(operator<<(basic_ostream<>&, _CharT), operator<<(basic_ostream<>&,
char), operator<<(basic_ostream<>&, const _CharT*),
operator<<(basic_ostream<>&, const char*),
operator<<(basic_ostream<>&, const basic_string<>&)): Remove.
* include/bits/basic_string.h (operator<<(basic_ostream<>&,
const basic_string<>&)): Use the latter, implement DR 586.
* config/abi/pre/gnu.ver: Adjust, export the new _M_insert.
* docs/html/ext/howto.html: Add an entry for DR 586.
* testsuite/21_strings/basic_string/inserters_extractors/char/
28277.cc: New.
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/
28277.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/
28277-3.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/
28277-4.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-2.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-3.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-4.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc')
-rw-r--r-- | libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc new file mode 100644 index 00000000000..ff6228f1240 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc @@ -0,0 +1,49 @@ +// 2006-10-12 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2006 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 21.3.7.9 inserters and extractors + +#include <ostream> +#include <sstream> +#include <testsuite_hooks.h> + +// libstdc++/28277 +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + wostringstream oss_01; + const wstring str_01(50, L'a'); + + oss_01.width(5000000); + const streamsize width = oss_01.width(); + + oss_01 << str_01; + + VERIFY( oss_01.good() ); + VERIFY( oss_01.str().size() == width ); +} + +int main() +{ + test01(); + return 0; +} |