2006-03-08 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Mar 2006 09:44:56 +0000 (09:44 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Mar 2006 09:44:56 +0000 (09:44 +0000)
Implement the resolution of DR 455, [DR].
* src/ios_init.cc (ios_base::Init::Init()): Do it.
* testsuite/27_io/objects/char/dr455.cc: New.
* testsuite/27_io/objects/wchar_t/dr455.cc: Likewise.
* docs/html/ext/howto.html: Add an entry for DR 455.

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

libstdc++-v3/ChangeLog
libstdc++-v3/docs/html/ext/howto.html
libstdc++-v3/src/ios_init.cc
libstdc++-v3/testsuite/27_io/objects/char/dr455.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/objects/wchar_t/dr455.cc [new file with mode: 0644]

index e6a1938..8a2f2fc 100644 (file)
@@ -1,3 +1,11 @@
+2006-03-08  Paolo Carlini  <pcarlini@suse.de>
+
+       Implement the resolution of DR 455, [DR].
+       * src/ios_init.cc (ios_base::Init::Init()): Do it.
+       * testsuite/27_io/objects/char/dr455.cc: New.
+       * testsuite/27_io/objects/wchar_t/dr455.cc: Likewise.
+       * docs/html/ext/howto.html: Add an entry for DR 455.
+
 2006-03-07  Paolo Carlini  <pcarlini@suse.de>
 
        * include/tr1/cmath: Add C99 overloads.
index cf87f6c..7fb2a6a 100644 (file)
     <dd>Don't fail if the next pointer is null and newoff is zero.
     </dd>
 
+    <dt><a href="lwg-defects.html#455">455</a>:
+        <em>cerr::tie() and wcerr::tie() are overspecified</em>
+    </dt>
+    <dd>Initialize cerr tied to cout and wcerr tied to wcout.
+    </dd>
+
     <dt><a href="lwg-defects.html#464">464</a>:
         <em>Suggestion for new member functions in standard containers</em>
     </dt>
index 7e3028e..93a3985 100644 (file)
@@ -1,6 +1,6 @@
 // Iostreams base classes -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -99,7 +99,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        new (&clog) ostream(&buf_cerr_sync);
        cin.tie(&cout);
        cerr.flags(ios_base::unitbuf);
-       
+       // _GLIBCXX_RESOLVE_LIB_DEFECTS
+       // 455. cerr::tie() and wcerr::tie() are overspecified.
+       cerr.tie(&cout);
+
 #ifdef _GLIBCXX_USE_WCHAR_T
        new (&buf_wcout_sync) stdio_sync_filebuf<wchar_t>(stdout);
        new (&buf_wcin_sync) stdio_sync_filebuf<wchar_t>(stdin);
@@ -111,6 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        new (&wclog) wostream(&buf_wcerr_sync);
        wcin.tie(&wcout);
        wcerr.flags(ios_base::unitbuf);
+       wcerr.tie(&wcout);      
 #endif
        
        // NB: Have to set refcount above one, so that standard
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/dr455.cc b/libstdc++-v3/testsuite/27_io/objects/char/dr455.cc
new file mode 100644 (file)
index 0000000..2cfbb32
--- /dev/null
@@ -0,0 +1,37 @@
+// 2006-03-08  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// DR 455. cerr::tie() and wcerr::tie() are overspecified.
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  VERIFY( std::cerr.tie() == &std::cout );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/dr455.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/dr455.cc
new file mode 100644 (file)
index 0000000..ab8abf3
--- /dev/null
@@ -0,0 +1,37 @@
+// 2006-03-08  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <iostream>
+#include <testsuite_hooks.h>
+
+// DR 455. cerr::tie() and wcerr::tie() are overspecified.
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  VERIFY( std::wcerr.tie() == &std::wcout );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}