]> 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>
Mon, 19 May 2025 09:45:17 +0000 (10:45 +0100)
commit53680c1aa92d9f78e8255fbf696c0ed36f160650
tree62199940c62de519ceb2624222bba26adaf6f6a5
parent57f73c3956572f30f3e0f7a350d958985b11daa5
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>
(cherry picked from commit c65725eccbabf3b9b5965f27fff2d3b9f6c75930)
libstdc++-v3/include/std/format
libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc