-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
consteval error with FreeBSD 13.1 and Clang13 #3032
Comments
I run into the same or similar issue on both GCC and clang on c++20. Reproduces on current master. Minimal reproduction: #include <string_view>
#include <fmt/core.h>
extern int get_number();
template<typename... Args>
inline void log_msg(std::string_view msg, Args... args){
fmt::print(msg, args...);
}
int main(){
log_msg("{}\n", get_number());
return 0;
} |
@mpiatka, the error in your example is unrelated and expected because the format string should be known at compile time: https://fmt.dev/latest/api.html#core-api. |
@phire, could you provide a repro (ideally on godbolt)? |
Godbolt doesn't seem to have freebsd, but I'll download a VM and get you a repro. |
I don't think it's a good idea because this config works on some systems, e.g. https://godbolt.org/z/rMcYPj66P. |
I wasn't able to repro the issue on the following test case: test.cc: #include <fmt/core.h>
int main() {
uint64_t full_u64;
auto s = fmt::format("{:02x}", full_u64);
}
Compile command: Please provide a self-contained repro. |
Closing as I wasn't able to reproduce the issue in the described configuration. Feel free to reopen with more repro details. |
I could try and make a minimal reproduction and/or test on master, but I don't have a freebsd system setup, and this is just #2455 again. If you need one, just ask.
Looks like last time you worked around this issue by disabling consteval for all AppleClang. But it seems the bug isn't in AppleClang, just when you have both Regular Clang and libc++. And now we have a second OS with libc++ plus a new enough version of Clang.
Our testing showed that upgrading to Clang14 fixed the issue. Also forcing
FMT_CONSTEVAL
off on FreeBSD + Clang13 fixed it dolphin-emu/dolphin#10973, which is the solution we will go with.But maybe you should update master to check for
_LIBCPP_VERSION
instead of__apple_build_version__
. Also, since this seems to be fixed in later versions of Clang, maybe you should limit that check to just Clang 13?The text was updated successfully, but these errors were encountered: