diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-01-10 20:54:11 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-01-12 09:45:53 +0000 |
commit | 5fbc1b2e7c1bdf11f64765b278f477310c0f3436 (patch) | |
tree | 37c6e706c14de661c699bae27cae7a084f6d2887 /gcc | |
parent | 35f8c661d67f53486f2f3e25887323476a7d0c2b (diff) | |
download | gcc-5fbc1b2e7c1bdf11f64765b278f477310c0f3436.zip gcc-5fbc1b2e7c1bdf11f64765b278f477310c0f3436.tar.gz gcc-5fbc1b2e7c1bdf11f64765b278f477310c0f3436.tar.bz2 |
libstdc++: Fix std::runtime_format deviations from the spec [PR113320]
I seem to have implemented this feature based on the P2918R0 revision,
not the final P2918R2 one that was approved for C++26. This commit fixes
it.
The runtime-format-string type should not have a publicly accessible
data member, so add a constructor and make it a friend of
basic_format_string. It should also be non-copyable, so that it can only
be constructed from a prvalue via temporary materialization. Change the
basic_format_string constructor parameter to pass by value. Also add
noexcept to the constructors and runtime_format generator functions.
libstdc++-v3/ChangeLog:
PR libstdc++/113320
* include/std/format (__format::_Runtime_format_string): Add
constructor and disable copy operations.
(basic_format_string(_Runtime_format_string)): Add noexcept and
take parameter by value not rvalue reference.
(runtime_format): Add noexcept.
* testsuite/std/format/runtime_format.cc: Check noexcept. Check
that construction is only possible from prvalues, not xvalues.
Reviewed-by: Daniel Krügler <daniel.kruegler@gmail.com>
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions