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

Fix handling of arrays in two-argument ranges::distance #2500

Closed
wants to merge 1 commit into from

Conversation

CaseyCarter
Copy link
Member

.... which was broken by LWG-3392. This implements the proposed resolution of a submitted-but-not-yet-numbered LWG issue.

.... which was broken by LWG-3392. This implements the proposed resolution of a submitted-but-not-yet-numbered LWG issue.
@CaseyCarter CaseyCarter added bug Something isn't working ranges C++20/23 ranges labels Jan 22, 2022
@CaseyCarter CaseyCarter requested a review from a team as a code owner January 22, 2022 22:43
@@ -3474,9 +3474,19 @@ namespace vso1121031 {
STATIC_ASSERT(!has_member_value_type<indirectly_readable_traits<iterish<float const volatile>>>);
} // namespace vso1121031

constexpr bool test_lwg_XXX() {
int a[3] = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add another const array for my paranoia

@@ -3474,9 +3474,19 @@ namespace vso1121031 {
STATIC_ASSERT(!has_member_value_type<indirectly_readable_traits<iterish<float const volatile>>>);
} // namespace vso1121031

constexpr bool test_lwg_XXX() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to annotate (here and in the header) with the proper issue number before merging.

@CaseyCarter CaseyCarter marked this pull request as draft January 24, 2022 20:45
@CaseyCarter
Copy link
Member Author

Converted to draft after Tim pointed out some issues with the PR.

Quuxplusone added a commit to llvm/llvm-project that referenced this pull request Jan 31, 2022
This includes an experimental workaround for
LWG3664 "LWG3392 broke std::ranges::distance(a, a+3)",
but the workaround may be incomplete, I'm not sure.
This should be re-audited when LWG3664 is actually adopted,
to see if we need to change anything about our implementation.

See also microsoft/STL#2500

Differential Revision: https://reviews.llvm.org/D117940
@CaseyCarter
Copy link
Member Author

This PR was superseded by #2522.

@CaseyCarter CaseyCarter closed this Feb 8, 2022
@CaseyCarter CaseyCarter deleted the array_distance branch February 8, 2022 01:39
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
This includes an experimental workaround for
LWG3664 "LWG3392 broke std::ranges::distance(a, a+3)",
but the workaround may be incomplete, I'm not sure.
This should be re-audited when LWG3664 is actually adopted,
to see if we need to change anything about our implementation.

See also microsoft/STL#2500

Differential Revision: https://reviews.llvm.org/D117940
arichardson pushed a commit to CTSRD-CHERI/llvm-project that referenced this pull request Jan 3, 2023
This includes an experimental workaround for
LWG3664 "LWG3392 broke std::ranges::distance(a, a+3)",
but the workaround may be incomplete, I'm not sure.
This should be re-audited when LWG3664 is actually adopted,
to see if we need to change anything about our implementation.

See also microsoft/STL#2500

Differential Revision: https://reviews.llvm.org/D117940
bsdjhb pushed a commit to CTSRD-CHERI/libcxx that referenced this pull request Jan 4, 2023
This includes an experimental workaround for
LWG3664 "LWG3392 broke std::ranges::distance(a, a+3)",
but the workaround may be incomplete, I'm not sure.
This should be re-audited when LWG3664 is actually adopted,
to see if we need to change anything about our implementation.

See also microsoft/STL#2500

Differential Revision: https://reviews.llvm.org/D117940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ranges C++20/23 ranges
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants