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

Workaround some Clang-16-rc2 regressions #3483

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

CaseyCarter
Copy link
Member

  • <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.

* `<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 CaseyCarter added the enhancement Something can be improved label Feb 20, 2023
@CaseyCarter CaseyCarter requested a review from a team as a code owner February 20, 2023 06:20
stl/inc/xutility Outdated Show resolved Hide resolved
@CaseyCarter
Copy link
Member Author

CaseyCarter commented Feb 21, 2023

  • <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.

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.

@StephanTLavavej
Copy link
Member

Yeah, I think the perma-workaround is fine.

@StephanTLavavej StephanTLavavej self-assigned this Feb 22, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej added bug Something isn't working and removed enhancement Something can be improved labels Feb 23, 2023
@StephanTLavavej StephanTLavavej merged commit b9b15d8 into microsoft:main Feb 23, 2023
@StephanTLavavej
Copy link
Member

Thanks for scouting out this Clang Future Technology! 🛸 🪄 😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants