This is an archive of the discontinued LLVM Phabricator instance.

[libc++][format] Addresses LWG3839.
ClosedPublic

Authored by Mordante on Feb 17 2023, 11:05 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGf68a536a6785: [libc++][format] Addresses LWG3839.
Summary
LWG3839 range_formatter's set_separator, set_brackets, and
underlying functions should be noexcept

Adds tests for:

template<ranges::input_range R, class charT>
   struct range-default-formatter<range_format::sequence, R, charT>

These were missing, the format functions tests for the sequences
are already present.

Diff Detail

Event Timeline

Mordante created this revision.Feb 17 2023, 11:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 11:05 AM
Mordante requested review of this revision.Feb 17 2023, 11:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 11:05 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Mar 7 2023, 9:18 AM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/docs/Status/Cxx2bIssues.csv
259

Commit message typo: sequenences

libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
41–42

You could use declval() and perhaps remove the comment about the SV macro (here and everywhere else)?

This revision is now accepted and ready to land.Mar 7 2023, 9:18 AM
Mordante edited the summary of this revision. (Show Details)Mar 7 2023, 10:08 AM
Mordante marked 2 inline comments as done.Mar 7 2023, 10:19 AM

Thanks for the review.

libcxx/test/std/utilities/format/format.tuple/set_separator.pass.cpp
41–42

I tried it and I'm not to thrilled by the code. I'll keep it as is. I think the comment is useful, originally I wrote
static_assert(noexcept(formatter.set_separator(SV("sep")))); which failed to compile since the SV macro could throw. Personally I like then to add a comment, to avoid the next developer to step in the same trap. In my experience the next developer is me in a couple of months ;-)

This revision was automatically updated to reflect the committed changes.
Mordante marked an inline comment as done.