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

format_to chrono compilation failure with msvc 14.32 and 14.33(_MSC_VER=1932 and 1933) in C++20 #3224

Closed
Klaim opened this issue Dec 11, 2022 · 3 comments

Comments

@Klaim
Copy link
Contributor

Klaim commented Dec 11, 2022

This issue only appears when using msvc 14.32 and 14.33(_MSC_VER=1932 and 1933) in C++20 and I was not able to set that up in godbolt because only the last vcpkg version is visible. Here is the issue:
https://godbolt.org/z/f5b9hnPv4

Notes:

  • changing to msvc 14.34 or latest will not hit that issue (so workaround: use latest msvc);
  • this looks like a conflict somewhere related to how the standard library is implemented in that case;
  • I can reproduce the issue using clang 15.0.1 locally in which cases it uses the msvc version I have installed, which goes with last point; unfortunately I cannot reproduce this setup using compiler explorer;
  • initially found when packaging for build2 : Release 9.0.0 and 9.1.0 build2-packaging/fmt#4 ;
  • affects at least 9.0.0 and 9.1.0
@Klaim Klaim changed the title format_to chrono incomatibility with msvc 14.32 and 14.33(_MSC_VER=1932 and 1933) in C++20 format_to chrono compilation failure with msvc 14.32 and 14.33(_MSC_VER=1932 and 1933) in C++20 Dec 11, 2022
Klaim added a commit to build2-packaging/fmt that referenced this issue Dec 11, 2022
This is due to a conflict between msvc's standard library and fmt when using `format_to`
using C++20 flags.
The issue have been reported:
fmtlib/fmt#3224

Recent and older versions of msvc will work as expected.
@vitaut
Copy link
Contributor

vitaut commented Dec 11, 2022

Looks like the problem is that std::format_to is picked by ADL. The fix is to namespace qualify the call to format_to, i.e. change it to fmt::format_to: https://godbolt.org/z/3cYh3Gso9.

Klaim added a commit to build2-packaging/fmt that referenced this issue Dec 11, 2022
This is due to a conflict between msvc's standard library and fmt when using `format_to`
using C++20 flags.
The issue have been reported:
fmtlib/fmt#3224

Recent and older versions of msvc will work as expected.
Klaim added a commit to build2-packaging/fmt that referenced this issue Dec 11, 2022
This is due to a conflict between msvc's standard library and fmt when using `format_to`
using C++20 flags.
The issue have been reported:
fmtlib/fmt#3224

Recent and older versions of msvc will work as expected.
@Klaim
Copy link
Contributor Author

Klaim commented Dec 11, 2022

@vitaut Damn, I just sent the package for publication but we can fix it in the test then
well I'll make a revision, thanks!

@vitaut
Copy link
Contributor

vitaut commented Dec 11, 2022

Applied the workaround to the test in 3999fd1.

@vitaut vitaut closed this as completed Dec 11, 2022
Klaim added a commit to build2-packaging/fmt that referenced this issue Dec 11, 2022
Klaim added a commit to build2-packaging/fmt that referenced this issue Dec 11, 2022
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

2 participants