This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Library C++ conformance question
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 14 Jun 2006 10:32:04 -0700 (PDT)
- Subject: Library C++ conformance question
- Reply-to: sje at cup dot hp dot com
I was looking at a test case related to the get_date function in
libstdc++ and ran into a standards question. If you look at the
libstdc++ test 22_locale/time_get/get_date/char/1.cc, in between calls
to get_date, the test sets errorstate to 'good' (ios_base::goodbit). If
you don't do this then errorstate gets set to eofbit by some calls to
get_date and then on the next call to get_date, if errorstate is still
set to eofbit, the call does not do anything and the test fails.
In paragraph 2 of section 22.2 of the C++ standard it says:
The get() members take an ios_base::iostate& argument whose
value they ignore, but set to ios_base::failbit in case of a
parse error."
So, shouldn't get_date (and other get_* functions) not be looking at
this value as it appears that they do? And should they be setting it to
eofbit at all, or should they just leave it as goodbit (unless a parse
error is found)?
Steve Ellcey
sje@cup.hp.com