public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109922] New: <iomanip>: consider removing operator>> for istream >> setfill(c)
@ 2023-05-21 10:16 fsb4000 at yandex dot ru
  2023-05-22 13:27 ` [Bug libstdc++/109922] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: fsb4000 at yandex dot ru @ 2023-05-21 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109922
           Summary: <iomanip>: consider removing operator>> for istream >>
                    setfill(c)
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fsb4000 at yandex dot ru
  Target Milestone: ---

Hi.

This is a mirror of a bug report: https://github.com/microsoft/STL/issues/3724

I noticed that libstdc++ has the same bug but LLVM libc++ doesn't have.

Look at the code

#include <iostream>
#include <iomanip>

int main()
{
    std::cin >> std::setfill('*');
}

According to the
standard(https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4944.pdf),
std::setfill is only for ostreams. Therefore, istream >> setfill(c) has no
well-defined meaning and can lead to confusion:
https://stackoverflow.com/questions/42530114/stdsetfill-and-stdsetw-for-input-streams

Initially reported by @achabense (https://github.com/achabense)

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

end of thread, other threads:[~2023-05-31 12:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21 10:16 [Bug libstdc++/109922] New: <iomanip>: consider removing operator>> for istream >> setfill(c) fsb4000 at yandex dot ru
2023-05-22 13:27 ` [Bug libstdc++/109922] " redi at gcc dot gnu.org
2023-05-23  2:12 ` de34 at live dot cn
2023-05-23  2:22 ` de34 at live dot cn
2023-05-25  9:24 ` redi at gcc dot gnu.org
2023-05-25  9:56 ` redi at gcc dot gnu.org
2023-05-31 12:21 ` cvs-commit at gcc dot gnu.org
2023-05-31 12:24 ` 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).