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

hana::any_of()/if_() example code fails on the latest MSVC #529

Closed
Arech opened this issue Apr 23, 2024 · 3 comments
Closed

hana::any_of()/if_() example code fails on the latest MSVC #529

Arech opened this issue Apr 23, 2024 · 3 comments

Comments

@Arech
Copy link

Arech commented Apr 23, 2024

Hey guys and gals, thank you for this awesome library!

I got a weird issue with hana::any_of() that I was even able to reproduce on godbolt: https://godbolt.org/z/6eaxaahYj

In short, even example code of hana::any_of() as described in the docs: https://www.boost.org/doc/libs/1_84_0/libs/hana/doc/html/group__group-_searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646 fails on the latest MSVC, but compiles nice on (not so latest) gcc & clang.

I've encountered that using boost v1.84 from vcpkg baseline 898b728edc5e0d12b50015f9cd18247c4257a3eb, but I assume godbolt uses different baseline and maybe even version, and nonetheless it fails there too with exactly the same diagnosis:

boost/hana/eval_if.hpp(60): error C2446: ':': no conversion from 'const boost::hana::integral_constant<bool,false>' to 'const boost::hana::integral_constant<bool,true>'
boost/hana/eval_if.hpp(60): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
....

I tried /Zc:__cplusplus suggestion, but no luck...

My MSVC Version 17.9.6. cl.exe version

Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64

I'll very much appreciate suggestions how to fix that. I didn't expect such issue, honestly...

@Arech Arech changed the title hana::any_of() example code fails on the latest MSVC hana::any_of()/if_() example code fails on the latest MSVC Apr 24, 2024
@Arech
Copy link
Author

Arech commented Apr 24, 2024

@Arech
Copy link
Author

Arech commented Apr 24, 2024

eval_if() example works though: https://godbolt.org/z/rWvdvjPKv

@Arech
Copy link
Author

Arech commented May 7, 2024

I posted this as a potential bug in MSVC bug tracker and just got a reply from their compiler team, that it compiles with /Zc:ternary and indeed, it at least compiles: https://godbolt.org/z/sWeG3s3nv

I guess this concludes the ticket, so I'm closing it.
Hana is so good that I expected it to be more lively supported :D

@Arech Arech closed this as completed May 7, 2024
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

1 participant