This is an archive of the discontinued LLVM Phabricator instance.

[libc++][format] Improves run-time diagnostics.
ClosedPublic

Authored by Mordante on Jul 15 2023, 5:42 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGa0ffeccc7076: [libc++][format] Improves run-time diagnostics.
Summary

After parsing a std-format-spec it's validated, depending on the type used some
format options are not allowed. This improves the error messages in the
exceptions thrown upon failure.

Depends on D155364

Diff Detail

Event Timeline

Mordante created this revision.Jul 15 2023, 5:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2023, 5:42 AM
Mordante updated this revision to Diff 540694.Jul 15 2023, 9:26 AM

CI fixes.

Mordante published this revision for review.Jul 15 2023, 11:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2023, 11:36 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jul 18 2023, 10:17 AM
ldionne added a subscriber: ldionne.

LGTM w/ comments.

libcxx/include/__format/parser_std_format_spec.h
201
223

inline.

241–247

WDYT about this? Then the consteval overload can be removed and IMO it's a bit more clear what's going on.

440–441
443
445
447
448–449
This revision is now accepted and ready to land.Jul 18 2023, 10:17 AM
Mordante marked 8 inline comments as done.Jul 18 2023, 12:01 PM
Mordante added inline comments.
libcxx/include/__format/parser_std_format_spec.h
241–247

I like the original code slightly better, but I don't object against the change.

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