Page MenuHomePhabricator

[libcxx] Fix LWG 2874: Constructor shared_ptr::shared_ptr(Y*) should be constrained.
Needs ReviewPublic

Authored by zoecarver on Jun 8 2020, 12:04 PM.


Group Reviewers
Restricted Project

Fix LWG 2874.

Diff Detail

Event Timeline

zoecarver created this revision.Jun 8 2020, 12:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2020, 12:04 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jun 9 2020, 8:05 AM

Nitpick: You've got the wrong LWG number in your commit message.

Also, can you please mark the LWG issue as complete in the docs?


You are eagerly instantiating all templates here, and I don't think that's what you want. For example, you'll instantiate __well_formed_delete_op<_Yp*> even when is_array<_Tp>::value is true.


STD_TEST_VERSION doesn't exist, it's TEST_STD_VER.

To catch these sorts of errors, it can be good to add tests and witness their failure before actually fixing them.

This revision now requires changes to proceed.Jun 9 2020, 8:05 AM
zoecarver edited the summary of this revision. (Show Details)Jun 9 2020, 9:17 PM
zoecarver marked an inline comment as done.Jun 9 2020, 9:25 PM
zoecarver added inline comments.

Oops, you're right. Somehow that got suck in my clipboard history.

zoecarver updated this revision to Diff 269730.Jun 9 2020, 9:28 PM
  • Update status.
  • Use TEST_STD_VER instead of the non-existant STD_TEST_VERSION.
  • Use std::conditional (instead of logical and/or).