[BUG]: cuda::std::variant, incoherent behaviour with Ambigous affectation
Is this a duplicate?
- [x] I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Compile-time Error
Component
libcu++
Describe the bug
Affecting an ambiguous value to a cuda::std::variant (for instance, trying to affect an int to a cuda::std::variant<long, short>) has a different comportment depending on the compiler pass.
How to Reproduce
- See godbold link bellow
- Observe that it fails to compile
- change the
#if 0to#if 1 - It still fails to compile despite the condition being the negation of the first one
Expected behavior
Both passes of the compiler should have the same behaviour (either allow or disallow such affectation). To get the same behaviour as std::variant, I believe that the assignment should be allowed (see here: https://godbolt.org/z/76fTqh5Yn).
Reproduction link
https://godbolt.org/z/fG5bvbcWz
Operating System
No response
nvidia-smi output
No response
NVCC version
tested with nvcc12.6.2 and nvcc12.8.1
Thanks for opening this issue, I believe this is a problem with the way system headers are treated with nvcc, I have changed the implementation slightly to ensure that we are using a workaround that we designed recently
@PaulGannay sorry, this is taking a bit longer than expected, we are running into compiler bugs that are nontrivial to work around
No problem, thank you for taking the time to look at it.
This should be fixed now on main, sorry for the long wait there were some compiler issues in the way