From: Benjamin Kosnik Date: Thu, 9 Oct 2003 16:53:54 +0000 (+0000) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93d046861d42e9779905f7db3c575923290eedf2;p=gcc.git [multiple changes] 2003-10-09 Benjamin Kosnik * src/string-inst.cc: Prune. * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. 2003-10-09 Petur Runolfsson * src/io-inst.cc: Don't include iostream. * include/bits/ios_base.h (ios_base::failure): Use string. * src/Makefile.am: Add ios_failure.cc. * src/Makefile.in: Regenerate. * src/ios.cc: Move ios_base::failure definitions to... * src/ios_failure.cc: ...here. New. From-SVN: r72272 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f367760a97e..f4a6f5b2682 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,18 @@ +2003-10-09 Benjamin Kosnik + + * src/string-inst.cc: Prune. + * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers. + * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. + +2003-10-09 Petur Runolfsson + + * src/io-inst.cc: Don't include iostream. + * include/bits/ios_base.h (ios_base::failure): Use string. + * src/Makefile.am: Add ios_failure.cc. + * src/Makefile.in: Regenerate. + * src/ios.cc: Move ios_base::failure definitions to... + * src/ios_failure.cc: ...here. New. + 2003-10-09 Petur Runolfsson PR libstdc++/9874 diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index db8f9c92525..43e5f9db936 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -29,7 +29,7 @@ // the GNU General Public License. // -// ISO C++ 14882: 27.8 File-based streams +// ISO C++ 14882: 27.4 Iostreams base classes // /** @file ios_base.h @@ -178,8 +178,7 @@ namespace std what() const throw(); private: - enum { _S_bufsize = 256 }; - char _M_name[_S_bufsize]; + string _M_msg; #endif }; diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index c2453b34cba..a79b6df0d2b 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -103,6 +103,7 @@ sources = \ globals.cc \ io-inst.cc \ ios.cc \ + ios_failure.cc \ istream-inst.cc \ limits.cc \ locale.cc \ diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 033c2d692e5..7a10f855352 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -262,6 +262,7 @@ sources = \ globals.cc \ io-inst.cc \ ios.cc \ + ios_failure.cc \ istream-inst.cc \ limits.cc \ locale.cc \ @@ -357,7 +358,7 @@ am__objects_2 = basic_file.lo c++locale.lo am__objects_3 = allocator-inst.lo codecvt.lo complex_io.lo \ concept-inst.lo ctype.lo demangle.lo ext-inst.lo \ fstream-inst.lo functexcept.lo globals.lo io-inst.lo ios.lo \ - istream-inst.lo limits.lo locale.lo locale-inst.lo \ + ios_failure.lo istream-inst.lo limits.lo locale.lo locale-inst.lo \ localename.lo misc-inst.lo ostream-inst.lo sstream-inst.lo \ stdexcept.lo stl_tree.lo streambuf-inst.lo string-inst.lo \ strstream.lo valarray-inst.lo wstring-inst.lo $(am__objects_1) \ diff --git a/libstdc++-v3/src/io-inst.cc b/libstdc++-v3/src/io-inst.cc index 2b0e29c3e2f..0b407ef3630 100644 --- a/libstdc++-v3/src/io-inst.cc +++ b/libstdc++-v3/src/io-inst.cc @@ -1,6 +1,6 @@ // Explicit instantiation file. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -34,7 +34,6 @@ #include #include -#include namespace std { diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 9dd0ecb53d7..ee282053aea 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -149,19 +149,6 @@ namespace std int ios_base::Init::_S_ios_base_init = 0; bool ios_base::Init::_S_synced_with_stdio = true; - ios_base::failure::failure(const string& __str) throw() - { - strncpy(_M_name, __str.c_str(), _S_bufsize); - _M_name[_S_bufsize - 1] = '\0'; - } - - ios_base::failure::~failure() throw() - { } - - const char* - ios_base::failure::what() const throw() - { return _M_name; } - ios_base::Init::Init() { if (_S_ios_base_init == 0) @@ -398,4 +385,4 @@ namespace std } return __ret; } -} // namespace std +} // namespace std diff --git a/libstdc++-v3/src/ios_failure.cc b/libstdc++-v3/src/ios_failure.cc new file mode 100644 index 00000000000..0d99ba303b8 --- /dev/null +++ b/libstdc++-v3/src/ios_failure.cc @@ -0,0 +1,48 @@ +// Iostreams base classes -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Free Software Foundation, Inc. +// +// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 27.4.2.1.1 Class ios_base::failure +// + +#include + +namespace std +{ + ios_base::failure::failure(const string& __str) throw() + : _M_msg(__str) { } + + ios_base::failure::~failure() throw() + { } + + const char* + ios_base::failure::what() const throw() + { return _M_msg.c_str(); } +} // namespace std diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc index 3fcaf5132e7..ec17e54c3d2 100644 --- a/libstdc++-v3/src/string-inst.cc +++ b/libstdc++-v3/src/string-inst.cc @@ -1,6 +1,6 @@ // Components for manipulating sequences of characters -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -73,23 +73,6 @@ namespace std template S::basic_string(S::iterator, S::iterator, const allocator&); - template - S::basic_string(S::const_iterator, S::const_iterator, const allocator&); - - template - S& - S::_M_replace(S::iterator, S::iterator, S::iterator, S::iterator, - input_iterator_tag); - - template - S& - S::_M_replace(S::iterator, S::iterator, S::const_iterator, - S::const_iterator, input_iterator_tag); - - template - S& - S::_M_replace(S::iterator, S::iterator, C*, C*, input_iterator_tag); - template S& S::_M_replace(S::iterator, S::iterator, const C*, const C*, @@ -99,15 +82,6 @@ namespace std S& S::_M_replace_safe(S::iterator, S::iterator, S::iterator, S::iterator); - template - S& - S::_M_replace_safe(S::iterator, S::iterator, S::const_iterator, - S::const_iterator); - - template - S& - S::_M_replace_safe(S::iterator, S::iterator, C*, C*); - template S& S::_M_replace_safe(S::iterator, S::iterator, const C*, const C*); @@ -117,11 +91,6 @@ namespace std S::_S_construct(S::iterator, S::iterator, const allocator&, forward_iterator_tag); - template - C* - S::_S_construct(S::const_iterator, S::const_iterator, - const allocator&, forward_iterator_tag); - template C* S::_S_construct(C*, C*, const allocator&, forward_iterator_tag); @@ -130,8 +99,4 @@ namespace std C* S::_S_construct(const C*, const C*, const allocator&, forward_iterator_tag); - - template - void - __destroy_aux(S*, S*, __false_type); } // namespace std diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc index f0baf752ef7..fe7a8ef9cc8 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc @@ -41,5 +41,5 @@ void test01() io1 = io2; } // { dg-error "within this context" "" { target *-*-* } 41 } -// { dg-error "is private" "" { target *-*-* } 748 } +// { dg-error "is private" "" { target *-*-* } 747 } // { dg-error "operator=" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc index 08865db583e..55033f950d1 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc @@ -41,5 +41,5 @@ void test02() test_base io2 = io1; } // { dg-error "within this context" "" { target *-*-* } 41 } -// { dg-error "is private" "" { target *-*-* } 745 } +// { dg-error "is private" "" { target *-*-* } 744 } // { dg-error "copy constructor" "" { target *-*-* } 0 }