re PR libstdc++/25649 (Bogus "uninitialized" warning)

2006-01-24  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/25649
	* include/std/std_istream.h (operator>>(short&), operator>>(int&)):
	Move out of line...
	* include/bits/istream.tcc: ... here.
	* include/std/std_ostream.h (operator<<(short), operator<<(int)):
	Move out of line...
	* include/bits/ostream.tcc: ... here.

From-SVN: r110186
This commit is contained in:
Paolo Carlini 2006-01-24 23:12:26 +00:00 committed by Paolo Carlini
parent 1bb8d49c5e
commit e7968bd850
5 changed files with 87 additions and 57 deletions

View File

@ -1,3 +1,13 @@
2006-01-24 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/25649
* include/std/std_istream.h (operator>>(short&), operator>>(int&)):
Move out of line...
* include/bits/istream.tcc: ... here.
* include/std/std_ostream.h (operator<<(short), operator<<(int)):
Move out of line...
* include/bits/ostream.tcc: ... here.
2006-01-24 Ed Smith-Rowland <3dw4rd@verizon.net> 2006-01-24 Ed Smith-Rowland <3dw4rd@verizon.net>
* docs/html/faq/index.html ([5.2]): Mention TR1 and point to * docs/html/faq/index.html ([5.2]): Mention TR1 and point to

View File

@ -1,6 +1,6 @@
// istream classes -*- C++ -*- // istream 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. // 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
@ -132,6 +132,46 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this; return *this;
} }
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(short& __n)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
long __l;
_M_extract(__l);
if (!this->fail())
{
if (numeric_limits<short>::min() <= __l
&& __l <= numeric_limits<short>::max())
__n = __l;
else
this->setstate(ios_base::failbit);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(int& __n)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
long __l;
_M_extract(__l);
if (!this->fail())
{
if (numeric_limits<int>::min() <= __l
&& __l <= numeric_limits<int>::max())
__n = __l;
else
this->setstate(ios_base::failbit);
}
return *this;
}
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>:: basic_istream<_CharT, _Traits>::

View File

@ -1,6 +1,6 @@
// ostream classes -*- C++ -*- // ostream 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. // 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
@ -120,6 +120,34 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this; return *this;
} }
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(short __n)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 117. basic_ostream uses nonexistent num_put member functions.
const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt == ios_base::oct || __fmt == ios_base::hex)
return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
else
return _M_insert(static_cast<long>(__n));
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(int __n)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 117. basic_ostream uses nonexistent num_put member functions.
const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt == ios_base::oct || __fmt == ios_base::hex)
return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
else
return _M_insert(static_cast<long>(__n));
}
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>:: basic_ostream<_CharT, _Traits>::

View File

@ -1,6 +1,6 @@
// Input streams -*- C++ -*- // Input streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// 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
@ -170,44 +170,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return _M_extract(__n); } { return _M_extract(__n); }
__istream_type& __istream_type&
operator>>(short& __n) operator>>(short& __n);
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
long __l;
_M_extract(__l);
if (!this->fail())
{
if (numeric_limits<short>::min() <= __l
&& __l <= numeric_limits<short>::max())
__n = __l;
else
this->setstate(ios_base::failbit);
}
return *this;
}
__istream_type& __istream_type&
operator>>(unsigned short& __n) operator>>(unsigned short& __n)
{ return _M_extract(__n); } { return _M_extract(__n); }
__istream_type& __istream_type&
operator>>(int& __n) operator>>(int& __n);
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
long __l;
_M_extract(__l);
if (!this->fail())
{
if (numeric_limits<int>::min() <= __l
&& __l <= numeric_limits<int>::max())
__n = __l;
else
this->setstate(ios_base::failbit);
}
return *this;
}
__istream_type& __istream_type&
operator>>(unsigned int& __n) operator>>(unsigned int& __n)

View File

@ -1,6 +1,6 @@
// Output streams -*- C++ -*- // Output streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
// 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
@ -176,16 +176,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return _M_insert(__n); } { return _M_insert(__n); }
__ostream_type& __ostream_type&
operator<<(short __n) operator<<(short __n);
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 117. basic_ostream uses nonexistent num_put member functions.
const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt == ios_base::oct || __fmt == ios_base::hex)
return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
else
return _M_insert(static_cast<long>(__n));
}
__ostream_type& __ostream_type&
operator<<(unsigned short __n) operator<<(unsigned short __n)
@ -196,16 +187,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
} }
__ostream_type& __ostream_type&
operator<<(int __n) operator<<(int __n);
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 117. basic_ostream uses nonexistent num_put member functions.
const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
if (__fmt == ios_base::oct || __fmt == ios_base::hex)
return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
else
return _M_insert(static_cast<long>(__n));
}
__ostream_type& __ostream_type&
operator<<(unsigned int __n) operator<<(unsigned int __n)