public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109772] New: Memory layout optimization of std::chrono::hh_mm_ss is wrong
@ 2023-05-08 14:41 redi at gcc dot gnu.org
  2023-05-08 14:41 ` [Bug libstdc++/109772] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-08 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109772
           Summary: Memory layout optimization of std::chrono::hh_mm_ss is
                    wrong
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Keywords: ABI
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <chrono>
#include <iostream>

int main()
{
    std::chrono::hh_mm_ss hms(std::chrono::duration<int, std::ratio<1,
1024>>{1511});
    std::cout << hms.subseconds().count() << '\n';
}

This prints 460892079 but the correct answer is 4755859375

It's being truncated to uint32_t.

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

end of thread, other threads:[~2024-05-21  9:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08 14:41 [Bug libstdc++/109772] New: Memory layout optimization of std::chrono::hh_mm_ss is wrong redi at gcc dot gnu.org
2023-05-08 14:41 ` [Bug libstdc++/109772] " redi at gcc dot gnu.org
2023-05-08 15:18 ` redi at gcc dot gnu.org
2023-05-08 15:59 ` redi at gcc dot gnu.org
2023-05-08 16:32 ` redi at gcc dot gnu.org
2023-05-10 22:47 ` [Bug libstdc++/109772] [13/14 Regression] " redi at gcc dot gnu.org
2023-05-11 20:19 ` cvs-commit at gcc dot gnu.org
2023-07-27  9:26 ` [Bug libstdc++/109772] [13 " rguenth at gcc dot gnu.org
2024-05-13 11:34 ` rguenth at gcc dot gnu.org
2024-05-21  9:15 ` jakub 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).