This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] libstdc++/7220


Hi,

the following testcase, distilled from the PR, passes with 3.0.4 (and Dinkum), doesn't with 3.1 and current v3:

#include <sstream>
#include <cassert>

#define Is std::basic_istream<char,std::char_traits<char> >
#define It std::char_traits<char>
#define Al std::allocator<char>

int main(int, char *[])
{
int res = 0;
std::streamsize n;
std::basic_string<char,It,Al > input((const char *)"abcdefg\n");
std::basic_stringbuf<char,It,Al > sbuf(input);
std::basic_istream<char,It > istr(&sbuf);

istr.ignore(0, (Is::int_type)'a');
assert( istr.gcount() == 0 );

return 0;
}

In your reading of the standard (27.6.1.3, 24), how ignore is supposed to behave in this case? When count == 0, and the next char is the delimiter ('a'), must it be eaten anyway or not?

Ciao, Paolo.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]