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
This commit is contained in:
Paolo Carlini 2007-02-27 17:48:09 +00:00 committed by Paolo Carlini
parent 01e7cd6e29
commit f4e39278b3
10 changed files with 44 additions and 23 deletions

View File

@ -1,3 +1,19 @@
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>
* acinclude.m4: Adjust regular expression for ld version extraction.

View File

@ -43,9 +43,6 @@
#pragma GCC system_header
#include <locale>
#include <ostream> // For flush()
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>

View File

@ -45,6 +45,7 @@
#include <ctime> // For struct tm
#include <cwctype> // For wctype_t
#include <cctype>
#include <bits/ctype_base.h>
#include <iosfwd>
#include <bits/ios_base.h> // For ios_base, ios_base::iostate

View File

@ -1,6 +1,7 @@
// 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.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -42,8 +43,6 @@
#pragma GCC system_header
#include <locale>
_GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>

View File

@ -1,6 +1,7 @@
// 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.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -42,8 +43,6 @@
#pragma GCC system_header
#include <sstream>
_GLIBCXX_BEGIN_NAMESPACE(std)
template <class _CharT, class _Traits, class _Alloc>

View File

@ -55,7 +55,7 @@
#include <string>
#include <bits/functexcept.h> // For invalid_argument, out_of_range,
// overflow_error
#include <ios>
#include <iosfwd>
#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long))
#define _GLIBCXX_BITSET_WORDS(__n) \
@ -1227,12 +1227,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
std::basic_istream<_CharT, _Traits>&
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;
__tmp.reserve(_Nb);
std::ios_base::iostate __state = std::ios_base::goodbit;
typename std::basic_istream<_CharT, _Traits>::sentry __sentry(__is);
typename __ios_base::iostate __state = __ios_base::goodbit;
typename __istream_type::sentry __sentry(__is);
if (__sentry)
{
try
@ -1249,7 +1252,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof))
{
__state |= std::ios_base::eofbit;
__state |= __ios_base::eofbit;
break;
}
else
@ -1262,18 +1265,18 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
else if (_Traits::eq_int_type(__buf->sputbackc(__c2),
__eof))
{
__state |= std::ios_base::failbit;
__state |= __ios_base::failbit;
break;
}
}
}
}
catch(...)
{ __is._M_setstate(std::ios_base::badbit); }
{ __is._M_setstate(__ios_base::badbit); }
}
if (__tmp.empty() && _Nb)
__state |= std::ios_base::failbit;
__state |= __ios_base::failbit;
else
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
if (__state)

View File

@ -43,7 +43,8 @@
#pragma GCC system_header
#include <bits/c++config.h>
#include <ios>
#include <iosfwd>
#include <bits/ios_base.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
@ -111,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _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);
return __os;

View File

@ -1,6 +1,7 @@
// 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.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -44,7 +45,6 @@
#include <bits/c++config.h>
#include <bits/c++locale.h>
#include <bits/c++io.h>
#include <cctype> // For isspace, etc.
#include <bits/stringfwd.h> // For string forward declarations.
#include <bits/postypes.h>
#include <bits/functexcept.h>

View File

@ -1,6 +1,7 @@
// 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.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -42,6 +43,8 @@
#pragma GCC system_header
#include <ios>
#include <locale>
#include <ostream>
#include <limits> // For numeric_limits
_GLIBCXX_BEGIN_NAMESPACE(std)

View File

@ -1,6 +1,7 @@
// 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.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -42,6 +43,7 @@
#pragma GCC system_header
#include <ios>
#include <locale>
_GLIBCXX_BEGIN_NAMESPACE(std)