public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113320] New: libstdc++ accepts std::format(std::move(runtime_fmt), 42);
@ 2024-01-11  1:19 hewillk at gmail dot com
  2024-01-11 10:38 ` [Bug libstdc++/113320] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hewillk at gmail dot com @ 2024-01-11  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113320
           Summary: libstdc++ accepts std::format(std::move(runtime_fmt),
                    42);
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

The new constructor of libstdc++'s basic_format_string accepts an rvalue
reference to a runtime-format-string instead of a value, which makes the
following incorrectly accepted:

  #include <format>

  int main() {
    auto runtime_fmt = std::runtime_format("{}");
    auto str = std::format(std::move(runtime_fmt), 42); // should error
  }

https://godbolt.org/z/zjW7shba1

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

end of thread, other threads:[~2024-01-12 20:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11  1:19 [Bug libstdc++/113320] New: libstdc++ accepts std::format(std::move(runtime_fmt), 42); hewillk at gmail dot com
2024-01-11 10:38 ` [Bug libstdc++/113320] " redi at gcc dot gnu.org
2024-01-11 22:50 ` redi at gcc dot gnu.org
2024-01-12  9:49 ` cvs-commit at gcc dot gnu.org
2024-01-12 20:38 ` 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).