]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix std::format_kind primary template for Clang [PR120190]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 15 May 2025 10:01:05 +0000 (11:01 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 15 May 2025 15:33:57 +0000 (16:33 +0100)
commitc65725eccbabf3b9b5965f27fff2d3b9f6c75930
tree7dd6b0f563a2ce8df3e1b0b1a71193a024a9a2d6
parent270d23c5b201c8e000f60e05d17577498f409441
libstdc++: Fix std::format_kind primary template for Clang [PR120190]

Although Clang trunk has been adjusted to handle our std::format_kind
definition (because they need to be able to compile the GCC 15.1.0
release), it's probably better to not rely on something that they might
start diagnosing again in future.

Define the primary template in terms of an immediately invoked function
expression, so that we can put a static_assert(false) in the body.

libstdc++-v3/ChangeLog:

PR libstdc++/120190
* include/std/format (format_kind): Adjust primary template to
not depend on itself.
* testsuite/std/format/ranges/format_kind_neg.cc: Adjust
expected errors. Check more invalid specializations.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Daniel Krügler <daniel.kruegler@gmail.com>
libstdc++-v3/include/std/format
libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc