Commit 12841eb3 by Benjamin Kosnik Committed by Benjamin Kosnik

re PR libstdc++/9371 (Bad exception handling in i/ostream::operator>>/<<(streambuf*))


2003-11-26  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/9371
	PR libstdc++/9546
	PR libstdc++/10093
	PR libstdc++/10095
	* include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
	(basic_ios::_M_setstate): Consolidate common error handling code.
	* include/bits/basic_ios.tcc: Tweak.
	* include/bits/fstream.tcc: Tweak.
	* include/bits/istream.tcc: Use _M_setstate for common exception
	handling. Move setstate calls after catch.
	(basic_istream::tellg): Check for exceptions thrown by streambuf
	virtual functions.
	(basic_istream::seekg): Same.
	* include/bits/ostream.tcc: Same, but for ostream.
	(basic_ostream::flush): Check for exceptions thrown by streambuf
	virtual functions.
	(basic_istream::tellp): Same.
	(basic_istream::seekp): Same.
	* include/bits/locale_facets.tcc: Tweak.
	* include/bits/streambuf.tcc: Tweak.
	(__copy_streambufs): Propagate exceptions.
	* testsuite/testsuite_io.h (fail_streambuf): New.
	(fail_num_get): New.
	(fail_num_put): New.
	(facet_error): New.
	(underflow_error): New.
	(overflow_error): New.
	(positioning_error): New.
	* testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
	* testsuite/27_io/basic_istream/extractors_arithmetic/char/
        exceptions_badbit_throw.cc, exceptions_failbit.cc,
        exceptions_failbit_throw.cc: New.
	* testsuite/27_io/basic_istream/extractors_other/char/
	error_failbit.cc, exceptions_badbit_throw.cc,
        exceptions_failbit_throw.cc, exceptions_null.cc: New.
	* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
	New.
	* testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
	New.
	* testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
	New.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/
	exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
	* testsuite/27_io/basic_ostream/inserters_other/char/
	error_failbit.cc, exceptions_badbit_throw.cc,
        exceptions_failbit_throw.cc, exceptions_null.cc: New.
	* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
	New.
	* testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
	New.

From-SVN: r73979
parent b483cfb7
2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/9371
PR libstdc++/9546
PR libstdc++/10093
PR libstdc++/10095
* include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
(basic_ios::_M_setstate): Consolidate common error handling code.
* include/bits/basic_ios.tcc: Tweak.
* include/bits/fstream.tcc: Tweak.
* include/bits/istream.tcc: Use _M_setstate for common exception
handling. Move setstate calls after catch.
(basic_istream::tellg): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::seekg): Same.
* include/bits/ostream.tcc: Same, but for ostream.
(basic_ostream::flush): Check for exceptions thrown by streambuf
virtual functions.
(basic_istream::tellp): Same.
(basic_istream::seekp): Same.
* include/bits/locale_facets.tcc: Tweak.
* include/bits/streambuf.tcc: Tweak.
(__copy_streambufs): Propagate exceptions.
* testsuite/testsuite_io.h (fail_streambuf): New.
(fail_num_get): New.
(fail_num_put): New.
(facet_error): New.
(underflow_error): New.
(overflow_error): New.
(positioning_error): New.
* testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit.cc,
exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_istream/extractors_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/
exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
* testsuite/27_io/basic_ostream/inserters_other/char/
error_failbit.cc, exceptions_badbit_throw.cc,
exceptions_failbit_throw.cc, exceptions_null.cc: New.
* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
New.
* testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
New.
2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/12297
* include/bits/istream.tcc
(basic_istream::sentry::sentry): Set failbit and eofbit when eof.
......
......@@ -141,7 +141,23 @@ namespace std
*/
void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
{
if (__state != ios_base::goodbit)
this->clear(this->rdstate() | __state);
}
// Flip the internal state on for the proper state bits, then re
// throws the propagated exception if bit also set in
// exceptions().
void
_M_setstate(iostate __state)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
_M_streambuf_state |= __state;
if (this->exceptions() & __state)
__throw_exception_again;
}
/**
* @brief Fast error checking.
......@@ -441,11 +457,6 @@ namespace std
void
_M_cache_locale(const locale& __loc);
// Internal state setter that won't throw, only set the state bits.
// Used to guarantee we don't throw when setting badbit.
void
_M_setstate(iostate __state) { _M_streambuf_state |= __state; }
};
} // namespace std
......
......@@ -42,7 +42,7 @@ namespace std
_M_streambuf_state = __state;
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
if (this->exceptions() & this->rdstate())
__throw_ios_failure("basic_ios::clear");
}
......
......@@ -134,9 +134,7 @@ namespace std
__testfail = true;
}
catch(...)
{
__testfail = true;
}
{ __testfail = true; }
// NB: Do this here so that re-opened filebufs will be cool...
this->_M_mode = ios_base::openmode(0);
......
......@@ -627,7 +627,7 @@ namespace std
__io.flags(__fmt);
unsigned long __ul;
std::__convert_to_v(__xtrc.c_str(), __ul, __err,
std::__convert_to_v(__xtrc.c_str(), __ul, __err,
_S_get_c_locale(), __base);
if (!(__err & ios_base::failbit))
__v = reinterpret_cast<void*>(__ul);
......
......@@ -126,8 +126,7 @@ namespace std
const size_t __n = __sbin->egptr() - __sbin->gptr();
if (__n > 1)
{
const size_t __wrote = __sbout->sputn(__sbin->gptr(),
__n);
const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n);
__sbin->gbump(__wrote);
__ret += __wrote;
if (__wrote < __n)
......@@ -144,12 +143,8 @@ namespace std
}
}
}
catch(exception& __fail)
{
__ios.setstate(ios_base::failbit);
if ((__ios.exceptions() & ios_base::failbit) != 0)
__throw_exception_again;
}
catch(...)
{ __throw_exception_again; }
return __ret;
}
......
......@@ -21,44 +21,36 @@
#include <istream>
#include <streambuf>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
// libstdc++/9561
struct foobar: std::exception { };
struct buf: std::streambuf
{
virtual int_type underflow () {
throw foobar ();
return -1;
}
virtual int_type uflow () {
throw foobar ();
return -1;
}
};
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
buf b;
__gnu_test::fail_streambuf b;
std::istream strm (&b);
strm.exceptions (std::ios::badbit);
int i = 0;
try {
i = strm.get();
}
catch (foobar) {
// strm should throw foobar and not do anything else
VERIFY(strm.bad());
}
catch (...) {
VERIFY(false);
}
try
{
i = strm.get();
i = strm.get();
i = strm.get();
}
catch (__gnu_test::underflow_error&)
{
// strm should throw facet_error and not do anything else
VERIFY(strm.bad());
}
catch (...)
{
VERIFY(false);
}
VERIFY(i == 0);
VERIFY(i == 's');
}
......
// 2003-03-08 Jerry Quinn <jlquinn@optonline.net>
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
// libstdc++/9561
template<typename T>
void test_badbit()
{
using namespace std;
bool test __attribute__((unused)) = true;
locale loc(locale::classic(), new __gnu_test::fail_num_get);
istringstream stream("jaylib - champion sound");
stream.imbue(loc);
stream.exceptions(ios_base::badbit);
VERIFY( stream.rdstate() == ios_base::goodbit );
try
{
T i;
stream >> i;
VERIFY( false );
}
catch (const __gnu_test::facet_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
int main()
{
test_badbit<bool>();
test_badbit<short>();
test_badbit<unsigned short>();
test_badbit<int>();
test_badbit<unsigned int>();
test_badbit<long>();
test_badbit<unsigned long>();
test_badbit<float>();
test_badbit<double>();
test_badbit<void*>();
return 0;
}
// Copyright (C) 2003
// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <sstream>
#include <testsuite_hooks.h>
// libstdc++/10093
template<typename T>
void test_failbit()
{
using namespace std;
bool test __attribute__((unused)) = true;
istringstream stream("jaylib - champion sound");
stream.exceptions(ios_base::failbit);
try
{
T i;
stream >> i;
VERIFY( false );
}
catch (const ios_base::failure&)
{
// stream should set failbit and throw ios_base::failure.
VERIFY( stream.fail() );
VERIFY( !stream.bad() );
VERIFY( !stream.eof() );
}
catch(...)
{ VERIFY( false ); }
}
int main()
{
test_failbit<bool>();
test_failbit<short>();
test_failbit<unsigned short>();
test_failbit<int>();
test_failbit<unsigned int>();
test_failbit<long>();
test_failbit<unsigned long>();
test_failbit<float>();
test_failbit<double>();
test_failbit<void*>();
return 0;
}
// Copyright (C) 2003
// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
// libstdc++/10093
template<typename T>
void test_failbit()
{
using namespace std;
bool test __attribute__((unused)) = true;
locale loc(locale::classic(), new __gnu_test::fail_num_get);
istringstream stream("jaylib - champion sound");
stream.imbue(loc);
stream.exceptions(ios_base::failbit);
try
{
T i;
stream >> i;
}
catch (const ios_base::failure&)
{ VERIFY( false ); }
catch(...)
{ VERIFY( false ); }
// stream should set badbit.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
int main()
{
test_failbit<bool>();
test_failbit<short>();
test_failbit<unsigned short>();
test_failbit<int>();
test_failbit<unsigned int>();
test_failbit<long>();
test_failbit<unsigned long>();
test_failbit<float>();
test_failbit<double>();
test_failbit<void*>();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test6()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stringbuf sbuf("", ios_base::out);
stream >> &sbuf;
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test8()
{
bool test __attribute__((unused)) = true;
istringstream stream("foo, bar, qux");
__gnu_test::fail_streambuf bob;
stream >> &bob;
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test6();
test8();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test14()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stream.exceptions(ios_base::badbit);
stringbuf sbuf("", ios_base::out);
try
{
stream >> &sbuf;
}
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test16()
{
bool test __attribute__((unused)) = true;
istringstream stream("foo, bar, qux");
stream.exceptions(ios_base::badbit);
__gnu_test::fail_streambuf bob;
try
{
stream >> &bob;
}
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test14();
test16();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test10()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stream.exceptions(ios_base::failbit);
stringbuf sbuf("", ios_base::out);
try
{
stream >> &sbuf;
VERIFY(false);
}
catch (ios_base::failure&)
{ VERIFY(false); }
catch (__gnu_test::underflow_error&)
{ }
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test12()
{
bool test __attribute__((unused)) = true;
istringstream stream("foo, bar, qux");
stream.exceptions(ios_base::failbit);
__gnu_test::fail_streambuf bob;
try
{
stream >> &bob;
VERIFY(false);
}
catch (ios_base::failure&)
{ VERIFY(false); }
catch (__gnu_test::overflow_error&)
{ }
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test10();
test12();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
using namespace std;
void test2()
{
bool test __attribute__((unused)) = true;
istringstream stream;
stream >> static_cast<streambuf*>(NULL);
VERIFY(stream.rdstate() & ios_base::failbit);
}
void test4()
{
bool test __attribute__((unused)) = true;
istringstream stream;
stream.exceptions(ios_base::failbit);
try
{
stream >> static_cast<streambuf*>(NULL);
VERIFY(false);
}
catch (ios_base::failure&)
{
}
VERIFY(stream.rdstate() & ios_base::failbit);
}
// libstdc++/9371
int main()
{
test2();
test4();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test01()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stream.exceptions(ios_base::badbit);
istream::pos_type pos;
try
{
stream.seekg(pos);
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
void test02()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stream.exceptions(ios_base::badbit);
istream::off_type off;
try
{
stream.seekg(off, ios_base::cur);
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
// libstdc++/9546
int main()
{
test01();
test02();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test01()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
istream stream(&bib);
stream.exceptions(ios_base::badbit);
try
{
stream.tellg();
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
// libstdc++/9546
int main()
{
test01();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test01()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
ostream stream(&bib);
stream.exceptions(ios_base::badbit);
try
{
stream.flush();
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
// libstdc++/9546
int main()
{
test01();
return 0;
}
// 2003-03-08 Jerry Quinn <jlquinn@optonline.net>
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
// libstdc++/9561
template<typename T>
void test_badbit()
{
using namespace std;
bool test __attribute__((unused)) = true;
locale loc(locale::classic(), new __gnu_test::fail_num_put);
ostringstream stream("jaylib - champion sound");
stream.imbue(loc);
stream.exceptions(ios_base::badbit);
VERIFY( stream.rdstate() == ios_base::goodbit );
try
{
T i;
stream << i;
VERIFY( false );
}
catch (const __gnu_test::facet_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
int main()
{
test_badbit<bool>();
test_badbit<short>();
test_badbit<unsigned short>();
test_badbit<int>();
test_badbit<unsigned int>();
test_badbit<long>();
test_badbit<unsigned long>();
test_badbit<float>();
test_badbit<double>();
return 0;
}
// Copyright (C) 2003
// 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
// libstdc++/10093
template<typename T>
void test_failbit()
{
using namespace std;
bool test __attribute__((unused)) = true;
locale loc(locale::classic(), new __gnu_test::fail_num_put);
ostringstream stream("jaylib - champion sound");
stream.imbue(loc);
stream.exceptions(ios_base::failbit);
try
{
T i;
stream << i;
}
catch (const ios_base::failure&)
{ VERIFY( false ); }
catch(...)
{ VERIFY( false ); }
// stream should set badbit.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
int main()
{
test_failbit<bool>();
test_failbit<short>();
test_failbit<unsigned short>();
test_failbit<int>();
test_failbit<unsigned int>();
test_failbit<long>();
test_failbit<unsigned long>();
test_failbit<float>();
test_failbit<double>();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test5()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bob;
ostream stream(&bob);
stringbuf sbuf("Foo, bar, qux", ios_base::in);
stream << &sbuf;
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test7()
{
bool test __attribute__((unused)) = true;
ostringstream stream;
__gnu_test::fail_streambuf bib;
stream << &bib;
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test5();
test7();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test13()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bob;
ostream stream(&bob);
stream.exceptions(ios_base::badbit);
stringbuf sbuf("Foo, bar, qux", ios_base::in);
try
{
stream << &sbuf;
}
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test15()
{
bool test __attribute__((unused)) = true;
ostringstream stream;
stream.exceptions(ios_base::badbit);
__gnu_test::fail_streambuf bib;
try
{
stream << &bib;
}
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test13();
test15();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test9()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bob;
ostream stream(&bob);
stream.exceptions(ios_base::failbit);
stringbuf sbuf("Foo, bar, qux", ios_base::in);
try
{
stream << &sbuf;
VERIFY(false);
}
catch (ios_base::failure&)
{ VERIFY(false); }
catch (__gnu_test::overflow_error&)
{ }
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
void test11()
{
bool test __attribute__((unused)) = true;
ostringstream stream;
stream.exceptions(ios_base::failbit);
__gnu_test::fail_streambuf bib;
try
{
stream << &bib;
VERIFY(false);
}
catch (ios_base::failure&)
{ VERIFY(false); }
catch (__gnu_test::underflow_error&)
{ }
catch (...)
{ VERIFY(false); }
VERIFY(stream.rdstate() & ios_base::failbit);
VERIFY((stream.rdstate() & ios_base::badbit) == 0);
}
// libstdc++/9371
int main()
{
test9();
test11();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <istream>
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
using namespace std;
void test1()
{
bool test __attribute__((unused)) = true;
ostringstream stream;
stream << static_cast<streambuf*>(NULL);
VERIFY(stream.rdstate() & ios_base::badbit);
}
void test3()
{
bool test __attribute__((unused)) = true;
ostringstream stream;
stream.exceptions(ios_base::badbit);
try
{
stream << static_cast<streambuf*>(NULL);
VERIFY(false);
}
catch (ios_base::failure&)
{
}
VERIFY(stream.rdstate() & ios_base::badbit);
}
// libstdc++/9371
int main()
{
test1();
test3();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test01()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
ostream stream(&bib);
stream.exceptions(ios_base::badbit);
ostream::pos_type pos;
try
{
stream.seekp(pos);
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
void test02()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
ostream stream(&bib);
stream.exceptions(ios_base::badbit);
ostream::off_type off;
try
{
stream.seekp(off, ios_base::cur);
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
// libstdc++/9546
int main()
{
test01();
test02();
return 0;
}
// Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <ostream>
#include <streambuf>
#include <sstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
using namespace std;
void test01()
{
bool test __attribute__((unused)) = true;
__gnu_test::fail_streambuf bib;
ostream stream(&bib);
stream.exceptions(ios_base::badbit);
try
{
stream.tellp();
VERIFY( false );
}
catch (const __gnu_test::positioning_error&)
{
// stream should set badbit and rethrow facet_error.
VERIFY( stream.bad() );
VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
VERIFY( !stream.eof() );
}
catch (...)
{
VERIFY(false);
}
}
// libstdc++/9546
int main()
{
test01();
return 0;
}
......@@ -70,8 +70,7 @@ namespace __gnu_test
bool one = this->pbase() == NULL;
bool two = this->pptr() == NULL;
return one && two;
}
}
};
// Used to check if basic_streambuf::pubsync() has been called.
......@@ -97,6 +96,164 @@ namespace __gnu_test
return 0;
}
};
// Throws on all overflow and underflow calls.
struct underflow_error: std::exception { };
struct overflow_error: std::exception { };
struct positioning_error: std::exception { };
struct fail_streambuf : std::streambuf
{
fail_streambuf()
{
static char p[] = "s";
setg(p, p, p + 1);
}
virtual int_type underflow()
{
throw underflow_error();
return -1;
}
virtual int_type uflow()
{
throw underflow_error();
return -1;
}
virtual int_type
overflow(int_type)
{
throw overflow_error();
return -1;
}
virtual pos_type
seekoff(off_type, std::ios_base::seekdir, std::ios_base::openmode)
{
throw positioning_error();
return pos_type(off_type(-1));
}
virtual pos_type
seekpos(pos_type, std::ios_base::openmode)
{
throw positioning_error();
return pos_type(off_type(-1));
}
virtual int
sync()
{
throw positioning_error();
return 0;
}
};
// Facets that throw an exception for every virtual function.
struct facet_error: std::exception { };
class fail_num_get : public std::num_get<char>
{
typedef std::ios_base ios_base;
protected:
iter_type
do_get(iter_type a, iter_type, ios_base&, ios_base::iostate&, bool&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
unsigned short&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
unsigned int&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
unsigned long&) const
{ throw facet_error(); return iter_type(); }
#ifdef _GLIBCXX_USE_LONG_LONG
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
long long&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
unsigned long long&) const
{ throw facet_error(); return iter_type(); }
#endif
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
float&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
double&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
long double&) const
{ throw facet_error(); return iter_type(); }
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
void*&) const
{ throw facet_error(); return iter_type(); }
};
class fail_num_put : public std::num_put<char>
{
typedef std::ios_base ios_base;
protected:
iter_type
do_put(iter_type, ios_base&, char_type __fill, bool __v) const
{ throw facet_error(); return iter_type(NULL); }
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long __v) const
{ throw facet_error(); return iter_type(NULL); }
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, unsigned long) const
{ throw facet_error(); return iter_type(NULL); }
#ifdef _GLIBCXX_USE_LONG_LONG
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long long __v) const
{ throw facet_error(); return iter_type(NULL); }
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const
{ throw facet_error(); return iter_type(NULL); }
#endif
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, double __v) const
{ throw facet_error(); return iter_type(NULL); }
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, long double __v) const
{ throw facet_error(); return iter_type(NULL); }
virtual iter_type
do_put(iter_type, ios_base&, char_type __fill, const void* __v) const
{ throw facet_error(); return iter_type(NULL); }
};
}; // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_IO_H
......
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