Page MenuHomePhabricator

[libcxx] Fix LWG 2875: shared_ptr::shared_ptr(Y*, D, […]) constructors should be constrained.
Needs ReviewPublic

Authored by zoecarver on Jun 8 2020, 11:21 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

Fixes LWG issue 2875.

Diff Detail

Event Timeline

zoecarver created this revision.Jun 8 2020, 11:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2020, 11:21 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jun 9 2020, 8:13 AM

Do we have tests that shared_ptr isn't constructible from incompatible array types? If not, could we add some?

Otherwise, mostly LGTM.

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
71

Nit: Please don't wrap here.

This revision now requires changes to proceed.Jun 9 2020, 8:13 AM
zoecarver updated this revision to Diff 269731.Jun 9 2020, 9:33 PM
  • Fix line wrapping

Do we have tests that shared_ptr isn't constructible from incompatible array types? If not, could we add some?

The __compatible_with trait removes the array extent. And (AFAIK) there are no array types that are convertible where their elements aren't. I'll make another patch to add tests that ensure we *can* construct a shared_ptr with array types that aren't convertible but where their elements are.