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

Fix MSVC warnings and compile errors #601

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

helmesjo
Copy link
Contributor

@helmesjo helmesjo commented Dec 18, 2023

Problem:

  • warning STL4038: The contents of <expected> are available only with C++23 or later.
  • sl.cpp(15,19): error C3688: invalid literal suffix '_i'; literal operator or literal operator template 'operator ""_i' not found
  • ut.cpp(93,5): error C7595: 'std::source_location::current': call to immediate function is not a constant expression
    • See reported bug here.
  • std::max clashes with Windows.h max() macro.

Solution:

  • Use #ifdef __cpp_lib_expected instead of __has_include(<expected>), the latter isn't reliable.
  • Make sure ut.hpp is compatible with Windows.h (push & pop min & max).
  • Work around bugs in MSVC.

Note that we also need #592 for the build to pass (after the rename from is_container_v to is_range_v).
Also there are still 7 of the unit tests (ut.cpp) that fails (#600) which is the case for MSVC as well.

Issue: #579

Reviewers:
@kris-jusiak

…rwise MSVC threw a warning 'The contents of <expected> are available only with C++23 or later.'.
…ing consteval functions when assigning argument default values. See VS Community issue 1669482
@helmesjo
Copy link
Contributor Author

helmesjo commented Dec 18, 2023

Actually, just realized that the windows compatibility test shouldn't be fixed the way I did. It should be ut.hpp that takes care of making sure it works. Will fix.

Edit: Fixed.

@kris-jusiak kris-jusiak merged commit 93cfddb into boost-ext:master Dec 18, 2023
6 of 8 checks passed
@helmesjo helmesjo deleted the fix-msvc-compile-errors branch December 19, 2023 07:15
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

Successfully merging this pull request may close these issues.

2 participants