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

Head does not compile in MSVC 16.10.1 with /std:c++latest /Zc:__cplusplus #2351

Closed
Spammed opened this issue Jun 11, 2021 · 5 comments
Closed

Comments

@Spammed
Copy link

Spammed commented Jun 11, 2021

MSVC 16.10.1 fails to compile current head with /std:c++latest /Zc:__cplusplus (-> #define __cplusplus 201705L)
but fails not with /std:c++latest /Zc:__cplusplus- (-> #define __cplusplus 199711L).

Code sample see: https://godbolt.org/z/e7zehe6fG

Compilation fails with message

format.h(899,29): error C3615: constexpr function 'fmt::v7::detail::count_digits' cannot result in a constant expression
format.h(904,35): message : failure was caused by variable declaration with non-automatic storage

@vitaut
Copy link
Contributor

vitaut commented Jun 11, 2021

The godbolt example compiles successfully. Was it supposed to demonstrate an error?

@DanielaE
Copy link
Contributor

I ran into the same problem.
Fixed with #2352

vitaut added a commit that referenced this issue Jun 11, 2021
@vitaut
Copy link
Contributor

vitaut commented Jun 11, 2021

Fixed in 3423d75. That piece of code is going away completely soon so we don't need the workaround, esp. broken one =).

@vitaut vitaut closed this as completed Jun 11, 2021
@DanielaE
Copy link
Contributor

Oh well, it took me ages to find out why gcc would fail to compile all of the time ...

@Spammed
Copy link
Author

Spammed commented Jun 11, 2021

Sorry, my code example should show the error, but not on Godbolt.

In addition, I have been fooled by Visual Studio:
In Visual Studio 16.10.1 (or 16.11 Preview 1.0) with /std:c++latest + /Zc:__cplusplus the compiler and Intellisense do not quite agree about __cplusplus:
Intellisense thinks __cpluplus would be '201705', but the compiled program outputs '202004'.
What a mess!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants