This is an archive of the discontinued LLVM Phabricator instance.

[libc++] LWG3738 Validates a missing precondition.
ClosedPublic

Authored by Mordante on Dec 22 2022, 11:11 AM.

Details

Reviewers
philnik
Group Reviewers
Restricted Project
Commits
rG0edc92e6e098: [libc++] LWG3738 Validates a missing precondition.
Summary

No real changes were needed, but add an assert for the pre-condition.

This implements:

  • 3738 Missing preconditions for take_view constructor

Diff Detail

Event Timeline

Mordante created this revision.Dec 22 2022, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 11:11 AM
Mordante requested review of this revision.Dec 22 2022, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 11:11 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik accepted this revision.Dec 22 2022, 11:14 AM
philnik added a subscriber: philnik.

LGTM with comments addressed and green CI.

libcxx/include/__ranges/take_view.h
19

This should be <__assert>, right?

69

Maybe something like "count has to be greater or equal to zero", to be a bit more descriptive?

This revision is now accepted and ready to land.Dec 22 2022, 11:14 AM
Mordante marked 2 inline comments as done.Dec 23 2022, 8:20 AM

Thanks for the review!

libcxx/include/__ranges/take_view.h
69

I think the condition tells the same, but no strong objection against the change.

This revision was landed with ongoing or failed builds.Dec 23 2022, 8:21 AM
This revision was automatically updated to reflect the committed changes.
Mordante marked an inline comment as done.