Current version of fmt doesn't compile with Clang 20
Compiling the project with Clang 20 throws some errors similar to this one:
/.conan2/p/b/ktxe2d82b5ecdfa0/b/src/external/fmt/include/fmt/format-inl.h:61:19: error: call to consteval function 'fmt::basic_format_string<char, fmt::basic_string_view<char> &, const char (&)[3]>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
61 | format_to(it, FMT_STRING("{}{}"), message, SEP);
| ^
...
We have successful builds with clang 20 and 21. What language standard are you compiling with? Our builds that use fmt{} default to c++17. I suspect you are trying something more recent and that, rather than clang, is the issue.
I compiled with C++26.
I think this should be the related issue.
hello, I have this problem too. I compiled it with C++20、C++26 with clang-20 in conan,and it always generate error:
: error: call to consteval function 'fmt::basic_format_string<char, const char (&)[7], int &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
62 | format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code);
| ^
my conan configuration is:
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu26
compiler.libcxx=libstdc++11
compiler.version=20
os=Linux
[conf]
tools.build:compiler_executables={'c': '/bin/clang-20', 'cpp': '/bin/clang++-20'}
Should be fixed by PR #1056.