[libc++] Fix template instantiation depth issues with std::tuple
authorLouis Dionne <ldionne.2@gmail.com>
Mon, 3 May 2021 16:06:28 +0000 (12:06 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Mon, 3 May 2021 18:42:07 +0000 (14:42 -0400)
commit84f0bb619507caf7c4809400138dae1da578282a
tree9a2ae05dc5eba057cfecccdc9d9421c4421ac324
parent9f3f6d7bd81ea26af9bcc2a2ac71a08affa341d4
[libc++] Fix template instantiation depth issues with std::tuple

This fixes the issue by implementing _And using the short-circuiting
SFINAE trick that we previously used only in std::tuple. One thing we
could look into is use the naive recursive implementation for disjunctions
with a small number of arguments, and use that trick with larger numbers
of arguments. It might be the case that the constant overhead for setting
up the SFINAE trick makes it only worth doing for larger packs, but that's
left for further work.

This problem was raised in https://reviews.llvm.org/D96523.

Differential Revision: https://reviews.llvm.org/D101661
libcxx/include/type_traits
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/recursion_depth.pass.cpp [new file with mode: 0644]