public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/110990] New: `format_to_n` returns wrong value
@ 2023-08-11 10:55 ensadc at mailnesia dot com
  2023-08-11 17:17 ` [Bug libstdc++/110990] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ensadc at mailnesia dot com @ 2023-08-11 10:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110990
           Summary: `format_to_n` returns wrong value
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://godbolt.org/z/4fv71hhGe
====
#include <format>
#include <iostream>

int main() {
    char buf[10] = "@@@@@@@@@";
    auto result = std::format_to_n(buf, std::size(buf), "a");

    std::cout << result.out - buf << '\n';
}

====
On libstdc++, `result.out - buf` evaluates to 10. I expect it to be 1. Both
libc++ and MSVC STL produce 1.

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

end of thread, other threads:[~2023-08-14 17:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 10:55 [Bug libstdc++/110990] New: `format_to_n` returns wrong value ensadc at mailnesia dot com
2023-08-11 17:17 ` [Bug libstdc++/110990] " redi at gcc dot gnu.org
2023-08-11 21:58 ` redi at gcc dot gnu.org
2023-08-11 22:34 ` cvs-commit at gcc dot gnu.org
2023-08-11 22:36 ` redi at gcc dot gnu.org
2023-08-14 17:48 ` cvs-commit at gcc dot gnu.org
2023-08-14 17:51 ` 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).