The following program does not compile with clang++ -std=c++23 -stdlib=libc++
:
<code>// clang++ -std=c++23 -stdlib=libc++ formatbug.cc
#include <format>
int
main(int argc, char **argv)
{
[[maybe_unused]] auto s = std::format("{0:}>" , argc);
}
</code>
<code>// clang++ -std=c++23 -stdlib=libc++ formatbug.cc
#include <format>
int
main(int argc, char **argv)
{
[[maybe_unused]] auto s = std::format("{0:}>" , argc);
}
</code>
// clang++ -std=c++23 -stdlib=libc++ formatbug.cc
#include <format>
int
main(int argc, char **argv)
{
[[maybe_unused]] auto s = std::format("{0:}>" , argc);
}
The compilation error claims I’m trying to evaluate a consteval function on a non constant expression. You can see the errors here. Is this just a straight-up bizarre bug in the standard library, or am I triggering some kind of weird digraph/trigraph functionality or advanced formatting feature with the character sequence “:}>”?