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
Applied LLVM-47414 workaround to std::ranges::join_view
#2352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks great, but we're missing a regression test. Could you please add your minimal repro as a test case in tests/std/tests/P0896R4_views_join/test.cpp
?
I added most of the requested changes in a new branch of my fork. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll go ahead and push changes for these trivial code review comments.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for improving This will ship in VS 2022 17.2 Preview 2. |
When piping into
std::views::join
, Clang eagerly instantiates thejoin_view::_InnerRng
template alias. This alias is used in the requirements of the resulting view'sconst
qualifiedbegin()
andend()
methods. This check is performed and causes a hard compile error even if the source contains no calls to theconst
qualified methods.I used the workaround applied to the same methods of
std::views::transform_view
.A simplified reproduction of code that fails to compile under Clang can be found here. Piping a
filter_view
or a view composed on top of afilter_view
will cause this erroneous compile error;filter_view
has no const qualified overloads ofbegin()
andend()
.