This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Implement LWG-3204 sub_match::swap only swaps the base class
ClosedPublic

Authored by fsb4000 on Feb 23 2023, 2:58 AM.

Diff Detail

Event Timeline

fsb4000 created this revision.Feb 23 2023, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 2:58 AM
fsb4000 requested review of this revision.Feb 23 2023, 2:58 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptFeb 23 2023, 2:58 AM
fsb4000 updated this revision to Diff 499800.Feb 23 2023, 3:50 AM
fsb4000 removed 1 blocking reviewer(s): Restricted Project.
fsb4000 updated this revision to Diff 499827.Feb 23 2023, 6:22 AM
JMazurkiewicz added inline comments.
libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
21

Both uses of this macro test if operation is noexcept - we can replace it with ASSERT_NOEXCEPT macro (https://github.com/llvm/llvm-project/blob/6c82d16d6092302c0d90ccb672a6ceba0b4a84d2/libcxx/test/support/test_macros.h#L219-L228).

46
70
fsb4000 added 1 blocking reviewer(s): Restricted Project.Feb 23 2023, 7:32 AM
fsb4000 updated this revision to Diff 499855.Feb 23 2023, 7:38 AM
fsb4000 marked 3 inline comments as done.

Thank you Jakub Mazurkiewicz!

fsb4000 updated this revision to Diff 499874.Feb 23 2023, 8:33 AM

_NOEXCEPT instead of noexcept for C++03 support

fsb4000 updated this revision to Diff 500032.Feb 23 2023, 6:34 PM
fsb4000 updated this revision to Diff 500038.Feb 23 2023, 6:54 PM

Thanks for your patch. In general LGTM, but I would like to have a look at the changes to the test.

libcxx/include/regex
5015

This is the preferred way. (At some point we probably should update the existing code base.)

5018

The indention looks off.

libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
26

This looks slightly confusion, I expect first and second to point to the same range.
Can you use the ideas used in libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp ?

fsb4000 added a reviewer: philnik.
fsb4000 updated this revision to Diff 500344.Feb 24 2023, 6:58 PM
fsb4000 marked 3 inline comments as done.
Mordante accepted this revision.Feb 25 2023, 5:42 AM

LGTM modulo some nits.

libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
22–23

This is our new style preference, the same for wchar_t.

27

please use clang-format for this new file.

This revision is now accepted and ready to land.Feb 25 2023, 5:42 AM
fsb4000 added inline comments.Feb 25 2023, 6:23 AM
libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
27

Is clang-format-15 ok?

I see that clang-format-16 is used but I only have clang-format-15.

Mordante added inline comments.Feb 25 2023, 6:39 AM
libcxx/test/std/re/re.submatch/re.submatch.members/swap.pass.cpp
27

Yes that's fine. They should behave the same for this file. We use a newer version for better formatting of C++20 features like concepts.

This revision was landed with ongoing or failed builds.Feb 25 2023, 6:45 AM
This revision was automatically updated to reflect the committed changes.
fsb4000 marked 3 inline comments as done.