public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108214] New: writinng bitset to stringstream fails
@ 2022-12-23 17:07 rhalbersma at gmail dot com
  2022-12-23 17:22 ` [Bug libstdc++/108214] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rhalbersma at gmail dot com @ 2022-12-23 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108214
           Summary: writinng bitset to stringstream fails
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rhalbersma at gmail dot com
  Target Milestone: ---

#include <bitset>
#include <sstream>

int main() {
    using T = std::bitset<1>;
    T a(1);
    T b;
    std::stringstream sstr;
    sstr << a;
    sstr >> b;
}

The above program works correctly for g++ until version 12, but for version 13
(trunk) it errors out with: "terminate called after throwing an instance of
'std::invalid_argument' what():  bitset::_M_copy_from_ptr"

Godbolt link: https://godbolt.org/z/nnKT6cddb

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

end of thread, other threads:[~2023-01-06 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 17:07 [Bug c++/108214] New: writinng bitset to stringstream fails rhalbersma at gmail dot com
2022-12-23 17:22 ` [Bug libstdc++/108214] [13 Regression] " pinskia at gcc dot gnu.org
2022-12-23 23:43 ` redi at gcc dot gnu.org
2023-01-06 14:11 ` cvs-commit at gcc dot gnu.org
2023-01-06 14:12 ` 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).