Commit f4e39278 by Paolo Carlini Committed by Paolo Carlini

PR libstdc++/28080 (partial)

2007-02-27  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/28080 (partial)
	* include/std/bitset: Do not include <ios>, <iosfwd> is enough.
	(operator>>(std::basic_istream<>&, bitset<>&)): Tweak, refer to
	ios_base as a base of basic_istream.
	* include/std/iomanip: Do not include <ios>, <iosfwd> + 
	<bits/ios_base.h> is enough.
	* include/std/iosfwd: Do not include <cctype> here...
	* include/bits/locale_facets.h: ... do it here, when needed.
	* include/bits/ostream.tcc: Clean up, do not include <locale> here...
	* include/std/ostream: ... here instead.
	* include/bits/istream.tcc: Likewise for <locale> and <ostream>...
	* include/std/istream: ... here.
	* include/bits/sstream.tcc: Do not include <sstream>.

From-SVN: r122380
parent 01e7cd6e
2007-02-27 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28080 (partial)
* include/std/bitset: Do not include <ios>, <iosfwd> is enough.
(operator>>(std::basic_istream<>&, bitset<>&)): Tweak, refer to
ios_base as a base of basic_istream.
* include/std/iomanip: Do not include <ios>, <iosfwd> +
<bits/ios_base.h> is enough.
* include/std/iosfwd: Do not include <cctype> here...
* include/bits/locale_facets.h: ... do it here, when needed.
* include/bits/ostream.tcc: Clean up, do not include <locale> here...
* include/std/ostream: ... here instead.
* include/bits/istream.tcc: Likewise for <locale> and <ostream>...
* include/std/istream: ... here.
* include/bits/sstream.tcc: Do not include <sstream>.
2007-02-27 Richard Guenther <rguenther@suse.de> 2007-02-27 Richard Guenther <rguenther@suse.de>
* acinclude.m4: Adjust regular expression for ld version extraction. * acinclude.m4: Adjust regular expression for ld version extraction.
......
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <locale>
#include <ostream> // For flush()
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <ctime> // For struct tm #include <ctime> // For struct tm
#include <cwctype> // For wctype_t #include <cwctype> // For wctype_t
#include <cctype>
#include <bits/ctype_base.h> #include <bits/ctype_base.h>
#include <iosfwd> #include <iosfwd>
#include <bits/ios_base.h> // For ios_base, ios_base::iostate #include <bits/ios_base.h> // For ios_base, ios_base::iostate
......
// ostream classes -*- C++ -*- // ostream classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -42,8 +43,6 @@ ...@@ -42,8 +43,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <locale>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
......
// String based streams -*- C++ -*- // String based streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -42,8 +43,6 @@ ...@@ -42,8 +43,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <sstream>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
template <class _CharT, class _Traits, class _Alloc> template <class _CharT, class _Traits, class _Alloc>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include <string> #include <string>
#include <bits/functexcept.h> // For invalid_argument, out_of_range, #include <bits/functexcept.h> // For invalid_argument, out_of_range,
// overflow_error // overflow_error
#include <ios> #include <iosfwd>
#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long)) #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long))
#define _GLIBCXX_BITSET_WORDS(__n) \ #define _GLIBCXX_BITSET_WORDS(__n) \
...@@ -1227,12 +1227,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) ...@@ -1227,12 +1227,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
{ {
typedef typename _Traits::char_type char_type; typedef typename _Traits::char_type char_type;
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
std::basic_string<_CharT, _Traits> __tmp; std::basic_string<_CharT, _Traits> __tmp;
__tmp.reserve(_Nb); __tmp.reserve(_Nb);
std::ios_base::iostate __state = std::ios_base::goodbit; typename __ios_base::iostate __state = __ios_base::goodbit;
typename std::basic_istream<_CharT, _Traits>::sentry __sentry(__is); typename __istream_type::sentry __sentry(__is);
if (__sentry) if (__sentry)
{ {
try try
...@@ -1249,7 +1252,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) ...@@ -1249,7 +1252,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
typename _Traits::int_type __c1 = __buf->sbumpc(); typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof)) if (_Traits::eq_int_type(__c1, __eof))
{ {
__state |= std::ios_base::eofbit; __state |= __ios_base::eofbit;
break; break;
} }
else else
...@@ -1262,18 +1265,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) ...@@ -1262,18 +1265,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
else if (_Traits::eq_int_type(__buf->sputbackc(__c2), else if (_Traits::eq_int_type(__buf->sputbackc(__c2),
__eof)) __eof))
{ {
__state |= std::ios_base::failbit; __state |= __ios_base::failbit;
break; break;
} }
} }
} }
} }
catch(...) catch(...)
{ __is._M_setstate(std::ios_base::badbit); } { __is._M_setstate(__ios_base::badbit); }
} }
if (__tmp.empty() && _Nb) if (__tmp.empty() && _Nb)
__state |= std::ios_base::failbit; __state |= __ios_base::failbit;
else else
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
if (__state) if (__state)
......
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
#pragma GCC system_header #pragma GCC system_header
#include <bits/c++config.h> #include <bits/c++config.h>
#include <ios> #include <iosfwd>
#include <bits/ios_base.h>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
...@@ -111,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -111,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
inline basic_ostream<_CharT, _Traits>& inline basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f) operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
{ {
__os.setf(__f._M_mask); __os.setf(__f._M_mask);
return __os; return __os;
......
// Forwarding declarations -*- C++ -*- // Forwarding declarations -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -44,7 +45,6 @@ ...@@ -44,7 +45,6 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/c++locale.h> #include <bits/c++locale.h>
#include <bits/c++io.h> #include <bits/c++io.h>
#include <cctype> // For isspace, etc.
#include <bits/stringfwd.h> // For string forward declarations. #include <bits/stringfwd.h> // For string forward declarations.
#include <bits/postypes.h> #include <bits/postypes.h>
#include <bits/functexcept.h> #include <bits/functexcept.h>
......
// Input streams -*- C++ -*- // Input streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -42,6 +43,8 @@ ...@@ -42,6 +43,8 @@
#pragma GCC system_header #pragma GCC system_header
#include <ios> #include <ios>
#include <locale>
#include <ostream>
#include <limits> // For numeric_limits #include <limits> // For numeric_limits
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// Output streams -*- C++ -*- // Output streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
#pragma GCC system_header #pragma GCC system_header
#include <ios> #include <ios>
#include <locale>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
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