Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround FreeBSD/clang/fmt bug #10973

Merged
merged 1 commit into from Aug 10, 2022
Merged

Conversation

phire
Copy link
Member

@phire phire commented Aug 10, 2022

/usr/home/buildbot/freebsd/pr-freebsd-x64/build/Source/UnitTests/Common/BitFieldTest.cpp:234:27: error: call to consteval function 'fmt::basic_format_string<char, BitField<0, 64, unsigned long, unsigned long> &>::basic_format_string<char [7], 0>' is not a constant expression
    EXPECT_EQ(fmt::format("{:02x}", object.full_u64),
                          ^
/usr/home/buildbot/freebsd/pr-freebsd-x64/build/Source/UnitTests/Common/BitFieldTest.cpp:234:27: note: undefined constructor 'basic_format_string<char [7], 0>' cannot be used in a constant expression
/usr/home/buildbot/freebsd/pr-freebsd-x64/build/Externals/fmt/include/fmt/core.h:3115:28: note: declared here
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                           ^
/usr/home/buildbot/freebsd/pr-freebsd-x64/build/Source/UnitTests/Common/BitFieldTest.cpp:236:27: error: call to consteval function 'fmt::basic_format_string<char, BitField<0, 64, long, long> &>::basic_format_string<char [7], 0>' is not a constant expression
    EXPECT_EQ(fmt::format("{:02x}", object.full_s64),

This appears to be a re-appearance of fmtlib/fmt#2455.

Except instead of being on AppleClang and MacOS, it's now on regular Clang and FreeBSD. Probably because the bug needs both clang13 and (some version of) llvm's libc++.

Our experiments showed that updating to Clang14 from ports appeared to fix it, but we would prefer to work with the stock freebsd 13.1. So, I've added a workaround to disable consteval on BSD with clang 13.

This is the same workaround that libfmt are already doing, except they detect AppleClang

@phire phire force-pushed the freebsd_fmt_consteval branch 2 times, most recently from 54cca71 to 4246c96 Compare August 10, 2022 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant