This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Better constain tuples constructors -- Fix PR23256 and PR22806
AbandonedPublic

Authored by EricWF on Aug 31 2015, 1:24 PM.

Details

Summary

This patch fixes the following bugs:

  • PR23256 tuple<A> is_constructible attempts tuple<A> to A conversion:
    • Fix this by disabling the UTypes... overloads using the __disable_tuple_args_ctor<...> meta-function.
  • PR22806 Move from destroyed object in tuple_cat of nested tuples
    • Fix this by disabling the tuple-like overloads using the __disable_tuple_like_ctor<...> meta-function.

The goal of the __disable_*_ctor metafunctions is to disable obviously incorrect constructor overloads before they evaluate more SFINAE and cause a hard compile error. The implementation of these traits uses NO SFINAE that could result in a hard compile error. These must be safe to evaluate always.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 33622.Aug 31 2015, 1:24 PM
EricWF retitled this revision from to [libcxx] Better constain tuples constructors -- Fix PR23256 and PR22806.
EricWF updated this object.
EricWF added reviewers: mclow.lists, eugenis, ldionne.
EricWF added a subscriber: cfe-commits.

Adding K-ballo and Howard Hinnant as reviewers. This patch could use all the eyes it could get.

eugenis edited edge metadata.Oct 2 2015, 7:46 PM

FYI, I ran some tests and did not find any regressions and also confirmed that this change fixes the problem PR23256 was minimized from.
Thanks for working on this!

EricWF added a comment.Oct 9 2015, 5:47 PM

Howard gave this approach and patch the thumbs up privately.

@mclow.lists What's holding you back from approving this?

ldionne edited edge metadata.Dec 21 2015, 6:32 PM

This LGTM. I also just confirmed that it fixes the original issue in Hana that caused me to report PR22806.

EricWF abandoned this revision.Apr 15 2016, 10:55 PM

Abandoning. This is super old and a different fix has been checked in.as r266461.