darling-libcxx/test
Eric Fiselier 522aaf67ea [libcxx] Delay evaluation of __make_tuple_types to prevent blowing the max template instantiation depth. Fixes Bug #18345
Summary:
http://llvm.org/bugs/show_bug.cgi?id=18345

Tuple's constructor and assignment operators for "tuple-like" types evaluates __make_tuple_types unnecessarily. In the case of a large array this can blow the template instantiation depth.

Ex:
```
#include <array>
#include <tuple>
#include <memory>
 
typedef std::array<int, 1256> array_t;
typedef std::tuple<array_t> tuple_t;

int main() {
  array_t a;
  tuple_t t(a); // broken
  t = a; // broken

  // make_shared uses tuple behind the scenes. This bug breaks this code.
  std::make_shared<array_t>(a);
}
```

To prevent this from happening we delay the instantiation of `__make_tuple_types` until after we perform the length check. Currently `__make_tuple_types` is instantiated at the same time that the length check .


Test Plan: Two tests have been added. One for the "tuple-like" constructors and another for the "tuple-like" assignment operator. 

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: K-ballo, cfe-commits

Differential Revision: http://reviews.llvm.org/D4467

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-28 06:31:22 +00:00
..
algorithms Create a 'comma_iterator' class that overloads operator, and asserts when it's called. Add tests to mismatch to make sure it can't be blindsided by such an evil iterator. More tests for other algorithms forthcoming. Thanks to STL for pointing this out at CppCon and Yakov Galka for opening LWG issue #2133 2014-09-16 20:38:11 +00:00
atomics Test that the single-threaded lit feature is available iff the corresponding guard is #defined 2014-10-27 22:39:19 +00:00
containers [libcxx] Fix use of operator comma where the types can be user defined 2014-10-27 19:28:20 +00:00
depr Some tests used __typeof__ instead of decltype. Replace these usages. 2014-10-21 15:07:09 +00:00
diagnostics Linux: Correctly identify valid error codes 2014-05-29 05:02:22 +00:00
experimental [libcxx] expose experimental::erased_type for all standard versions. 2014-07-24 19:17:38 +00:00
extensions Do not derive __gnu_cxx::hash<T> from std::hash<T>. 2014-03-06 04:11:10 +00:00
input.output Whitespace maintenance. Remove a bunch of tabs that snuck in. No functionality change 2014-10-18 11:03:33 +00:00
iterators Implement LWG 2360: 'reverse_iterator::operator*() is unimplementable'. Note that this is a (small) behavior change in the library. Reverse iterators whose base iterators' operator* return references to 'within themselves' have been sacrificed to the greater goal of avoiding data races. 2014-03-11 17:16:17 +00:00
language.support Some tests used __typeof__ instead of decltype. Replace these usages. 2014-10-21 15:07:09 +00:00
localization [libcxx] XFAIL all currently failing libc++ tests for linux. 2014-10-23 21:17:36 +00:00
numerics [libcxx] Fix SFINAE in <cmath>. Patch from K-Ballo. 2014-10-17 00:31:47 +00:00
re [libcxx] Remove use of uniform initialization from regex tests so that they compile in C++03. 2014-10-27 19:29:32 +00:00
strings Mark cuchar tests as always xfail since we don't provide the header' 2014-08-18 05:09:51 +00:00
support Fix use of operator comma in is_permutation and delete comma operator for test iterators. 2014-10-27 20:26:25 +00:00
thread Add support for "fancy" pointers to promise and packaged_task. 2014-10-23 06:24:45 +00:00
utilities [libcxx] Delay evaluation of __make_tuple_types to prevent blowing the max template instantiation depth. Fixes Bug #18345 2014-10-28 06:31:22 +00:00
CMakeLists.txt [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args. 2014-08-23 04:33:20 +00:00
lit.cfg Add special case handling of linux target triples that do not contain -gnu. 2014-10-27 22:14:25 +00:00
lit.site.cfg.in [libcxx] Redo adding support for building and testing with an ABI library not along linker paths 2014-10-19 00:42:41 +00:00
nothing_to_do.pass.cpp Test commit: Reverting whitespace changes 2014-07-17 05:10:03 +00:00
testit Apply patch for Albert Wong: 'Modify testit to allow filtering tests by prefixes'. 2014-01-15 16:28:42 +00:00