ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.05k stars 437 forks source link

Cast issue with GCC12 #1798

Open perache opened 8 months ago

perache commented 8 months ago

Does it make sense to keep cast at line 362 ? It causes narrowing conversion error with GCC12 and thus, the compilation crashes.

https://github.com/ericniebler/range-v3/blob/9aa41d6b8ded2cf5e8007e66a0efd1ab33dbf9a5/include/range/v3/view/zip_with.hpp#L357-L369

JohelEGP commented 8 months ago

It causes narrowing conversion error with GCC12 and thus, the compilation crashes.

If the compiler crashes, there's a compiler bug that should be reported. Does the same happen with GCC13? What about GCC14 (trunk)?

perache commented 8 months ago

The compiler does not crash; the compilation stops due to a narrowing error. If I remove the std::size_t cast. The error disappears. I didn't try GCC13 or GCC14.