aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-02-29 16:13:13 +0000
committerJonathan Wakely <jwakely@redhat.com>2024-03-07 20:55:24 +0000
commit24a2b5def06940f3f181418a439c408388f7eb56 (patch)
treec60d068741d107f8136847472f154b7aff902585 /gcc
parent0ed6e5b4820e01fa86b48a7b1d62f752ec97ea41 (diff)
downloadgcc-24a2b5def06940f3f181418a439c408388f7eb56.zip
gcc-24a2b5def06940f3f181418a439c408388f7eb56.tar.gz
gcc-24a2b5def06940f3f181418a439c408388f7eb56.tar.bz2
libstdc++: Better diagnostics for std::format errors
This adds two new static_assert messages to the internals of std::make_format_args to give better diagnostics for invalid format args. Rather than just getting an error saying that basic_format_arg cannot be constructed, we get more specific errors for the cases where std::formatter isn't specialized for the type at all, and where it's specialized but only meets the BasicFormatter requirements and so can only format non-const arguments. Also add a test for the existing static_assert when constructing a format_string for non-formattable args. libstdc++-v3/ChangeLog: * include/std/format (_Arg_store::_S_make_elt): Add two static_assert checks to give more user-friendly error messages. * testsuite/lib/prune.exp (libstdc++-dg-prune): Prune another form of "in requirements with" note. * testsuite/std/format/arguments/args_neg.cc: Check for user-friendly diagnostics for non-formattable types. * testsuite/std/format/string_neg.cc: Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions