http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46906
--- Comment #5 from Marc Glisse <marc.glisse at normalesup dot org> 2011-09-05 09:58:19 UTC --- (In reply to comment #4) > IMO the example program is broken and cannot be used to proof violation of > contract of the library. This is so, because istreambuf_iterator is an input > iterator and any usage of operator++ potentially invalidates copies of the > iterator (see FDIS, Table 107, expression r++). You are completely right, thanks. On the other hand, it looks like I can construct i2 from s (instead of copying from i1) and still hit the same issue with a valid program. Do you agree? (Hmm, could the standard make it undefined to interlace uses of an istreambuf_iterator and other operations on the istreambuf, to allow this behavior?)