This code:
#include
#include
#include
#include
int main()
{
std::remove(\"test.txt\");
Ok, separate from the version analysis, which I'll leave for good measure, here is the answer:
I'll try to find source, but this thread discusses whether the documentation needs to be updated due to this change. It is therefore, a documented change :)
Edit Only found this: libstdc++/26211 (again) + N3168
From this page: http://gcc.gnu.org/ml/libstdc++/2011-04/msg00026.html
Hey, all.
I recently started using gcc-4.6.0 and it seems that the behaviour of std::istream::tellg() has changed when (just) the eofbit is set. I managed to track this down to PR/26211, and I'm not debating the changes.
It took me a while to figure out what was wrong because the doxygen for tellg() says:
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
That's almost word for word what Langer and Kreft says, so I'm presuming DR60's change to 27.6.1.3 paragraph 37 has lead to this change in libstdc++ behaviour.
Should the libstdc++ doxygen be updated to say something about the fact that calling
tellg()
wheneof()
will also returnpos_type(-1)
(because of the fact that it constructs a sentry)? Are there other functions that also should have updated documentation as a result of DR60?