OSDN Git Service

2003-10-09 Benjamin Kosnik <bkoz@redhat.com>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Oct 2003 16:53:54 +0000 (16:53 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Oct 2003 16:53:54 +0000 (16:53 +0000)
* 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  <peturr02@ru.is>

* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72272 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/ios_base.h
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in
libstdc++-v3/src/io-inst.cc
libstdc++-v3/src/ios.cc
libstdc++-v3/src/ios_failure.cc [new file with mode: 0644]
libstdc++-v3/src/string-inst.cc
libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc

index f367760..f4a6f5b 100644 (file)
@@ -1,3 +1,18 @@
+2003-10-09  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * 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  <peturr02@ru.is>
+
+       * 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  <peturr02@ru.is>
 
        PR libstdc++/9874
index db8f9c9..43e5f9d 100644 (file)
@@ -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
     };
 
index c2453b3..a79b6df 100644 (file)
@@ -103,6 +103,7 @@ sources = \
        globals.cc \
        io-inst.cc \
        ios.cc \
+       ios_failure.cc \
        istream-inst.cc \
        limits.cc \
        locale.cc \
index 033c2d6..7a10f85 100644 (file)
@@ -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) \
index 2b0e29c..0b407ef 100644 (file)
@@ -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 <ios>
 #include <iomanip>
-#include <iostream>
 
 namespace std
 {
index 9dd0ecb..ee28205 100644 (file)
@@ -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 (file)
index 0000000..0d99ba3
--- /dev/null
@@ -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 <ios>
+
+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
index 3fcaf51..ec17e54 100644 (file)
@@ -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<C>&);
 
-  template 
-    S::basic_string(S::const_iterator, S::const_iterator, const allocator<C>&);
-
-  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<C>&, forward_iterator_tag);
 
-  template 
-    C* 
-    S::_S_construct(S::const_iterator, S::const_iterator, 
-                   const allocator<C>&, forward_iterator_tag);
-
   template
     C*
     S::_S_construct(C*, C*, const allocator<C>&, forward_iterator_tag);
@@ -130,8 +99,4 @@ namespace std
     C*
     S::_S_construct(const C*, const C*, const allocator<C>&,
                    forward_iterator_tag);
-
-  template
-    void
-    __destroy_aux<S*>(S*, S*, __false_type);
 } // namespace std
index f0baf75..fe7a8ef 100644 (file)
@@ -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 } 
index 08865db..55033f9 100644 (file)
@@ -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 }