Created on 2003-09-18.00:00:00 last changed 73 months ago
[ Kona: The LWG agreed that this is probably what we want. However, we need a review to find all places where functions in clause 27 take arguments of type streamsize that shouldn't be allowed to go negative. Martin will do that review. ]
Proposed resolution:
I propose that we add to each function in clause 27 that takes an argument, say N, of type streamsize a Requires clause saying that "N >= 0." The intent is to allow negative streamsize values in calls to precision() and width() but disallow it in calls to streambuf::sgetn(), istream::ignore(), or ostream::write().
[ 2018-12-04 Reflector prioritization ]
Set Priority to 3
[ LEWG Kona 2017 ]
Recommend Open: We agree that we should require N >= 0 for the selected functions
[ 2009-07 Frankfurt ]
This is related to LWG 255.
Move to NAD Future.
A third party test suite tries to exercise istream::ignore(N) with a negative value of N and expects that the implementation will treat N as if it were 0. Our implementation asserts that (N >= 0) holds and aborts the test.
I can't find anything in section 27 that prohibits such values but I don't see what the effects of such calls should be, either (this applies to a number of unformatted input functions as well as some member functions of the basic_streambuf template).
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-12-09 12:44:26 | admin | set | messages: + msg10248 |
2018-06-22 06:38:21 | admin | set | messages: + msg9952 |
2018-06-22 06:38:21 | admin | set | status: lewg -> open |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2010-10-21 18:28:33 | admin | set | messages: + msg2577 |
2010-10-21 18:28:33 | admin | set | messages: + msg2576 |
2010-10-21 18:28:33 | admin | set | messages: + msg2575 |
2003-09-18 00:00:00 | admin | create |