Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[libc++] Makes `unique_ptr operator*() noexcept.
Needs RevisionPublic

Authored by Mordante on Jun 20 2022, 9:08 AM.

Details

Reviewers
philnik
ldionne
Group Reviewers
Restricted Project
Summary

This implements

  • LWG2762 unique_ptr operator*() should be noexcept.

Diff Detail

Event Timeline

Mordante created this revision.Jun 20 2022, 9:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 9:08 AM
Mordante requested review of this revision.Jun 20 2022, 9:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 9:08 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik accepted this revision as: philnik.Jun 20 2022, 9:21 AM
philnik added a subscriber: philnik.

Could you include in the title that this isn't just modifying unique_ptr? Other than a few nits this LGTM assuming CI passes.

libcxx/include/__memory/unique_ptr.h
272–286

Maybe replace _LIBCPP_INLINE_VISIBILITY while you're at it?

273

It gets removed if noexcept() isn't supported anyways.

Mordante planned changes to this revision.Jun 20 2022, 10:20 AM

Thanks for the review!

However I will put this on hold. The CI failure seems to indicate there's an issue with the LWG issue. GCC agrees with Clang so I need to do some more investigation.

libcxx/include/__memory/unique_ptr.h
273

Good point.

Mordante updated this revision to Diff 438773.Jun 21 2022, 11:18 AM

An experiment to fix the CI issue.

Mordante planned changes to this revision.Jun 21 2022, 11:21 AM
Mordante marked an inline comment as done.
Mordante added inline comments.
libcxx/include/__memory/unique_ptr.h
277

Note this is just an experiment and not intended to be landed in this fashion.

Mordante updated this revision to Diff 438779.Jun 21 2022, 11:26 AM

tab -> space.

Mordante updated this revision to Diff 520193.May 7 2023, 10:04 AM

Rebased, resolved merge conflicts, and updated to current libc++ style.

Mordante updated this revision to Diff 520199.May 7 2023, 10:39 AM

CI fixes.

Mordante updated this revision to Diff 520203.May 7 2023, 11:21 AM

CI fixes.

Mordante updated this revision to Diff 555095.Thu, Aug 31, 10:29 AM

Rebased to trigger CI.

Mordante updated this revision to Diff 556364.Sun, Sep 10, 3:32 AM

Rebased to trigger CI.

ldionne requested changes to this revision.Tue, Sep 12, 10:26 AM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/include/__memory/unique_ptr.h
272

_LIBCPP_HIDE_FROM_ABI while we're at it.

284

I don't understand. Why is the void* case not important pre-C++20?

libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
27

I don't think this typedef is needed.

This revision now requires changes to proceed.Tue, Sep 12, 10:26 AM