[PATCH] D12502: [libcxx] Better constain tuples constructors -- Fix PR23256 and PR22806

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 13:24:29 PDT 2015


EricWF created this revision.
EricWF added reviewers: mclow.lists, eugenis, ldionne.
EricWF added a subscriber: cfe-commits.

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.



http://reviews.llvm.org/D12502

Files:
  include/__tuple
  include/tuple
  test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp
  test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR23256_constrain_UTypes_ctor.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12502.33622.patch
Type: text/x-patch
Size: 13826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150831/455e03fe/attachment.bin>


More information about the cfe-commits mailing list