mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 03:08:54 +08:00
ostream.tcc (ostream::put): Fixed error condition check.
2001-07-18 Stephen M. Webb <stephen@bregmasoft..com> Roman Sulzhyk <roman_sulzhyk@yahoo.com> libstdc++/3599 * include/bits/ostream.tcc (ostream::put): Fixed error condition check. * testsuite/27_io/streambuf.cc (test07): Added new regression test. Co-Authored-By: Roman Sulzhyk <roman_sulzhyk@yahoo.com> From-SVN: r44122
This commit is contained in:
parent
6a65ea5be3
commit
fed3b7b431
@ -1,3 +1,10 @@
|
||||
2001-07-18 Stephen M. Webb <stephen@bregmasoft..com>
|
||||
Roman Sulzhyk <roman_sulzhyk@yahoo.com>
|
||||
|
||||
libstdc++/3599
|
||||
* include/bits/ostream.tcc (ostream::put): Fixed error condition check.
|
||||
* testsuite/27_io/streambuf.cc (test07): Added new regression test.
|
||||
|
||||
2001-07-17 Stephen M. Webb <stephen@bregmasoft.com>r
|
||||
|
||||
All occurrences of the __value_type() and __distance_type()
|
||||
|
@ -358,7 +358,7 @@ namespace std
|
||||
if (__cerb)
|
||||
{
|
||||
int_type __put = rdbuf()->sputc(__c);
|
||||
if (__put != traits_type::to_int_type(__c))
|
||||
if (traits_type::eq_int_type(__put, traits_type::eof()))
|
||||
this->setstate(ios_base::badbit);
|
||||
}
|
||||
return *this;
|
||||
|
@ -337,6 +337,30 @@ namespace gnu
|
||||
class gnu::something_derived : std::streambuf { };
|
||||
#endif
|
||||
|
||||
// libstdc++/3599
|
||||
class testbuf2 : public std::streambuf
|
||||
{
|
||||
public:
|
||||
typedef std::streambuf::traits_type traits_type;
|
||||
|
||||
testbuf2() : std::streambuf() { }
|
||||
|
||||
protected:
|
||||
int_type
|
||||
overflow(int_type c = traits_type::eof())
|
||||
{ return traits_type::not_eof(0); }
|
||||
};
|
||||
|
||||
void
|
||||
test07()
|
||||
{
|
||||
testbuf2 ob;
|
||||
std::ostream out(&ob);
|
||||
|
||||
VERIFY(out << "gasp");
|
||||
VERIFY(out << std::endl);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
@ -345,5 +369,7 @@ int main()
|
||||
|
||||
test04();
|
||||
test05();
|
||||
|
||||
test07();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user