Workaround some Clang-16-rc2 regressions#3483
Merged
StephanTLavavej merged 2 commits intomicrosoft:mainfrom Feb 23, 2023
Merged
Workaround some Clang-16-rc2 regressions#3483StephanTLavavej merged 2 commits intomicrosoft:mainfrom
StephanTLavavej merged 2 commits intomicrosoft:mainfrom
Conversation
* `<ranges>`: wrap `zip_transform_view`'s constraints in a named concept so we can redeclare the class template, e.g., in a `friend` declaration. Repetitions of atomic constraints with equal expressions do not subsume, and Clang 16 is enforcing this rule more strictly. * `<xutility>`: allow clang-format to format some more code, add some parens to keep it from going wild. Define a `_Store_size` helper concept for `subrange` instead of using a `static constexpr bool` class member as a perma-workaround for LLVM-60868. * `tests/std/tests/P0323R12_expected`: Don't reference a local variable in a local class definition. (Clang 16 refuses to compile this; I suspect current compilers should as well.) These changes don't make all tests pass with Clang 16, but should suffice to enable it to use the STL.
CaseyCarter
commented
Feb 20, 2023
CaseyCarter
commented
Feb 20, 2023
StephanTLavavej
approved these changes
Feb 21, 2023
Contributor
Author
FYI: From the discussion in LLVM-60777 (which seems to share a root cause with LLVM-60868) the change that's triggering this issue is probably going to be reverted before the Clang 16 release. (There's a bug in the speculative implementation of CWG-2628.) I'm still inclined to apply the perma-workaround, since we want the constraints on the constructors to apply to implicitly-generated deduction guides, and I can't imagine that working well when our existing constraint depends on a static class member. |
Member
|
Yeah, I think the perma-workaround is fine. |
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for scouting out this Clang Future Technology! 🛸 🪄 😻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<ranges>: wrapzip_transform_view's constraints in a named concept so we can redeclare the class template, e.g., in afrienddeclaration. Repetitions of atomic constraints with equal expressions do not subsume, and Clang 16 is enforcing this rule more strictly.<xutility>: allow clang-format to format some more code, add some parens to keep it from going wild. Define a_Store_sizehelper concept forsubrangeinstead of using astatic constexpr boolclass member as a perma-workaround for LLVM-60868.tests/std/tests/P0323R12_expected: Don't reference a local variable in a local class definition. (Clang 16 refuses to compile this; I suspect current compilers should as well.)These changes don't make all tests pass with Clang 16, but should suffice to enable it to use the STL.