public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97719] New: "Implement C++20 features for <sstream>" changed behavior of istreambuf_iterator
@ 2020-11-04 20:42 rodgertq at gcc dot gnu.org
  2020-11-04 21:38 ` [Bug libstdc++/97719] [11 Regression] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rodgertq at gcc dot gnu.org @ 2020-11-04 20:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97719

            Bug ID: 97719
           Summary: "Implement C++20 features for <sstream>" changed
                    behavior of istreambuf_iterator
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rodgertq at gcc dot gnu.org
  Target Milestone: ---

from mailing list -

On 07/10/2020 18:55, Thomas Rodgers wrote:
From: Thomas Rodgers <trodgers@redhat.com>
New ctors and ::view() accessor for -
  * basic_stingbuf
  * basic_istringstream
  * basic_ostringstream
  * basic_stringstreamm
New ::get_allocator() accessor for basic_stringbuf.
I found that this
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a0e4d7b44c544c84cffc7ff9c64b6f1af14fb08d>
"libstdc++: Implement C++20 features for <sstream>" changed the behavior of

$ cat test.cc
#include <iostream>
#include <iterator>
#include <sstream>
int main() {
 std::stringstream s("a");
 std::istreambuf_iterator<char> i(s);
 if (i != std::istreambuf_iterator<char>()) std::cout << *i << '\n';
}
$ g++ -std=c++20 test.cc
$ ./a.out

from printing "a" to printing nothing.  (The `i != ...` comparison appears to
change i from pointing at "a" to pointing to null, and returns false.)

I ran into this when building LibreOffice, and I hope test.cc is a faithfully
minimized reproducer.  However, I know little about std::istreambuf_iterator,
so it may well be that the code isn't even valid.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-04 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 20:42 [Bug libstdc++/97719] New: "Implement C++20 features for <sstream>" changed behavior of istreambuf_iterator rodgertq at gcc dot gnu.org
2020-11-04 21:38 ` [Bug libstdc++/97719] [11 Regression] " redi at gcc dot gnu.org
2020-11-04 21:38 ` redi at gcc dot gnu.org
2020-11-04 23:41 ` cvs-commit at gcc dot gnu.org
2020-11-04 23:41 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).