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

Static assertion build error in Visual Studio 17.7 #117

Closed
DeveloperPaul123 opened this issue Aug 10, 2023 · 2 comments · Fixed by #118
Closed

Static assertion build error in Visual Studio 17.7 #117

DeveloperPaul123 opened this issue Aug 10, 2023 · 2 comments · Fixed by #118
Labels
bug Something isn't working

Comments

@DeveloperPaul123
Copy link
Contributor

When using the Visual Studio generator to build flux I'm now getting this build error:

flux\test\test_read_only.cpp(132,28): error C2607: static assertion failed
flux\test\test_read_only.cpp(132,28): message : the concept 'std::same_as<std::pair<const int &,const double &>,std::pair<const int &&,const double &&>>' evaluated to false
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.37.32822\include\concepts(36,9): message : 'std::pair<const int &,const double &>' and 'std::pair<const int &&,const double &&>' are different types

The offending code in concepts.hpp. FLUX_HAVE_CPP23_TUPLE_COMMON_REF is true in this context.

#ifdef FLUX_HAVE_CPP23_TUPLE_COMMON_REF
    std::common_reference_with<element_t<Seq>&&, value_t<Seq>&> &&
    std::common_reference_with<rvalue_element_t<Seq>&&, value_t<Seq> const&> &&
#endif
@tcbrindle
Copy link
Owner

Thanks @DeveloperPaul123, not sure how I missed this when I was testing the new VS release the other day!

I get the same thing when compiling with GCC13 in C++23 mode. It looks like the culprit was #97, which removed the move_at() specialisation for read_only_adaptor.

(As an aside: perhaps it's worth running CI with both CXX_STANDARD=20 and CXX_STANDARD=23 on the latest compilers to catch things like this?)

tcbrindle added a commit that referenced this issue Aug 10, 2023
Since #97 this was falling back to `map_adaptor::move_at()`, which does the wrong thing in C++23 mode when the base element type is something like `tuple<T&>`.

Fixes #117
@tcbrindle tcbrindle added the bug Something isn't working label Aug 10, 2023
@tcbrindle
Copy link
Owner

This should now be fixed, but please let me know if there are any other problems. Thanks again for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants