gcc/libstdc++-v3/testsuite/27_io/ios_base
Jonathan Wakely 85d0fad469 PR libstdc++/68197 fail on negative iword/pword indices
The suggested resolution of LWG 3083 is to make invalid indices
undefined, but we can fairly easily check for them and treat them as
errors in the same way as allocation failure. This avoids a segfault or
worse, setting an error flag on the stream instead.

	PR libstdc++/68197
	* include/bits/ios_base.h (ios_base::iword, ios_base::pword): Cast
	indices to unsigned.
	* src/c++11/ios.cc (ios_base::_M_grow_words): Treat negative indices
	as failure. Refactor error handling.
	* testsuite/27_io/ios_base/storage/68197.cc: New.

From-SVN: r259854
2018-05-02 20:04:55 +01:00
..
callbacks Update copyright years. 2018-01-03 11:03:58 +01:00
cons Update copyright years. 2018-01-03 11:03:58 +01:00
failure PR libstdc++/85222 allow catching iostream errors as gcc4-compatible ios::failure 2018-04-10 15:36:09 +01:00
state Update copyright years. 2018-01-03 11:03:58 +01:00
storage PR libstdc++/68197 fail on negative iword/pword indices 2018-05-02 20:04:55 +01:00
sync_with_stdio Update copyright years. 2018-01-03 11:03:58 +01:00
types Update copyright years. 2018-01-03 11:03:58 +01:00