-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fmtlib does not compile with MSVC v140 #4346
Comments
Even if one fixes this issue there's still a ton of different seemingly unrelated compile errors starting with the 11.1.x release series. Bisecting leads to 761d35f as the first bad commit. |
This looks like a bug in specific compiler version considering that Line 742 in d42a068
and it works on other versions of the same compiler. I recommend updating to a newer compiler version, e.g. v141 which is known to work: https://github.com/fmtlib/fmt/actions/runs/13189537160/job/36820689152. If there is an easy workaround, a PR would be welcome too. |
A simple workaround could be to skip that static assert on msvc, since it will always be true |
I think it's fine to remove the static assert if it helps (a PR is welcome), it doesn't add much value anyway. |
No need to remove the diff --git a/include/fmt/base.h b/include/fmt/base.h
index 8fdcea7c..ce71ad98 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -740,7 +740,7 @@ class basic_specs {
};
unsigned data_ = 1 << fill_size_shift;
- static_assert(sizeof(data_) * CHAR_BIT >= 18, "");
+ static_assert(sizeof(basic_specs::data_) * CHAR_BIT >= 18, "");
// Character (code unit) type is erased to prevent template bloat.
char fill_data_[max_fill_size] = {' '}; As previously mentioned, however, this does not fix the compilation errors using the vc140 toolset because more errors arise after a fix. |
v140 is pretty old and we don't claim compatibility with it. But as I wrote earlier, if there is an easy fix, a PR would be welcome. |
Issue
The MSVC v140 build breaks with the attached errors.
System
Visual Studio 2022 (17.12.4) with MSVC v140 - VS 2015 C++-Buildtools (v14.00)
Details
Steps to reproduce
git checkout v1.15.1
cmake -T v140 -S . -B build/ && cmake --build build/
The text was updated successfully, but these errors were encountered: