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

Cast issue with GCC12 #1798

Open
perache opened this issue Oct 25, 2023 · 2 comments
Open

Cast issue with GCC12 #1798

perache opened this issue Oct 25, 2023 · 2 comments

Comments

@perache
Copy link

perache commented Oct 25, 2023

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

requires and_v<sized_range<Rngs const>...>)
{
using size_type = common_type_t<range_size_t<Rngs const>...>;
return range_cardinality<iter_zip_with_view>::value >= 0
? size_type{(
std::size_t)range_cardinality<iter_zip_with_view>::value}
: tuple_foldl(tuple_transform(rngs_,
[](auto && r) -> size_type {
return ranges::size(r);
}),
(std::numeric_limits<size_type>::max)(),
detail::min_);
}

@JohelEGP
Copy link
Contributor

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
Copy link
Author

perache commented Oct 26, 2023

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.

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

2 participants