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

<ranges>: Fix formatting ranges for ADL-only ranges #5178

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

hewillk
Copy link
Contributor

@hewillk hewillk commented Dec 10, 2024

This is the followup of #5173.

@hewillk hewillk requested a review from a team as a code owner December 10, 2024 12:19
@hewillk
Copy link
Contributor Author

hewillk commented Dec 10, 2024

Sorry, how do I format the code? I don't have a rep, I'm just editing it on the GitHub web.

stl/inc/format Outdated Show resolved Hide resolved
Co-authored-by: A. Jiang <[email protected]>
@CaseyCarter CaseyCarter added the bug Something isn't working label Dec 10, 2024
@CaseyCarter
Copy link
Member

Sorry, how do I format the code? I don't have a rep, I'm just editing it on the GitHub web.

For future reference, you can click "details" on the STL-CI check, click the link on that page to get to the Azure pipeline run:

image

There will be 1 attached artifact:

image

which is a patch with format corrections:

diff --git a/stl/inc/format b/stl/inc/format
index 2b7aa8c..6026f34 100644
--- a/stl/inc/format
+++ b/stl/inc/format
@@ -3271,7 +3271,7 @@ void _Range_formatter_format_as_sequence(const formatter<_Ty, _CharT>& _Underlyi
     auto _Iter       = _RANGES begin(_Rng);
     const auto _Sent = _RANGES end(_Rng);
     for (; _Iter != _Sent; ++_Iter) {
-        auto&& _Elem  = *_Iter;
+        auto&& _Elem = *_Iter;
         if (_Separate) {
             _Ctx.advance_to(_STD _Fmt_write(_Ctx.out(), _Separator));
         }

@StephanTLavavej StephanTLavavej added ranges C++20/23 ranges format C++20/23 format labels Dec 10, 2024
@StephanTLavavej
Copy link
Member

We should add test coverage for this, but it's not critical enough to push changes to the PR and possibly trip the de minimis threshold for the CLA (if you haven't signed it yet - I haven't checked). We're unlikely to mess with this again in the short term, so the risk is low. I've added a personal todo to follow up here.

@StephanTLavavej StephanTLavavej self-assigned this Dec 12, 2024
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit d4b57c7 into microsoft:main Dec 13, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this bug in one of our newest and soon-to-be-popular features! 🛠️ 🐞 4️⃣

@hewillk hewillk deleted the main-format-ranges branch December 13, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working format C++20/23 format ranges C++20/23 ranges
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants