libstdc++: Implement P2918R0 "Runtime format strings II" for C++26
commitcddaff46adfd831d4836f29dc5e21f73eaed37b3
authorJonathan Wakely <jwakely@redhat.com>
Sun, 7 Jan 2024 23:14:31 +0000 (7 23:14 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 8 Jan 2024 01:14:51 +0000 (8 01:14 +0000)
tree9f97291f576333852cc2ae98dd8d65aab3203bab
parent2a8ee2592e48735d88df786cbafa6b0da39fc4d6
libstdc++: Implement P2918R0 "Runtime format strings II" for C++26

This adds std::runtime_format for C++26. These new overloaded functions
enhance the std::format API so that it isn't necessary to use the less
ergonomic std::vformat and std::make_format_args (which are meant to be
implementation details). This was approved in Kona 2023 for C++26.

libstdc++-v3/ChangeLog:

* include/std/format (__format::_Runtime_format_string): Define
new class template.
(basic_format_string): Add non-consteval constructor for runtime
format strings.
(runtime_format): Define new function for C++26.
* testsuite/std/format/runtime_format.cc: New test.
libstdc++-v3/include/std/format
libstdc++-v3/testsuite/std/format/runtime_format.cc [new file with mode: 0644]