This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix PR22806 - Tuple incorrectly selects copy/move constructor when storing nested tuple-like types.
AbandonedPublic

Authored by EricWF on Mar 9 2015, 11:14 AM.

Details

Summary

There are two conflicting constructors in tuple:

template <class ..._Up>
tuple(_Up&&...) // Construct from elements.

template <class _Tuple>
tuple(_Tuple&&) // copy/move constructor.

When the length of the tuple is 1 and the first element is a tuple then we can incorrectly select the copy/move constructor. This patch adds more SFINAE to try and prevent this.
This patch likely needs more work.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 21501.Mar 9 2015, 11:14 AM
EricWF retitled this revision from to [libcxx] Fix PR22806 - Tuple incorrectly selects copy/move constructor when storing nested tuple-like types..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, ldionne, K-ballo.
EricWF added a subscriber: Unknown Object (MLST).

I think this patch is actually pretty close to correct but thinking about tuple hurts my brain.

@mclow.lists can you start reviewing this when you have time.

I think this patch is actually pretty close to correct but thinking about tuple hurts my brain.

@mclow.lists can you start reviewing this when you have time.

@mclow.lists Nevermind I think I have a better fix to this.

EricWF accepted this revision.Aug 31 2015, 1:25 PM
EricWF added a reviewer: EricWF.

Abandoning for patch D12502.

This revision is now accepted and ready to land.Aug 31 2015, 1:25 PM
EricWF abandoned this revision.Aug 31 2015, 1:26 PM

Actually abandoning. Sorry for the spam.