tuple_array_template_depth.pass.cpp 957 B

1234567891011121314151617181920212223242526272829303132333435
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // UNSUPPORTED: c++98, c++03
  9. // <tuple>
  10. // template <class... Types> class tuple;
  11. // template <class Tuple, __tuple_assignable<Tuple, tuple> >
  12. // tuple & operator=(Tuple &&);
  13. // This test checks that we do not evaluate __make_tuple_types
  14. // on the array when it doesn't match the size of the tuple.
  15. #include <array>
  16. #include <tuple>
  17. // Use 1256 to try and blow the template instantiation depth for all compilers.
  18. typedef std::array<char, 1256> array_t;
  19. typedef std::tuple<array_t> tuple_t;
  20. int main(int, char**)
  21. {
  22. array_t arr;
  23. tuple_t tup;
  24. tup = arr;
  25. return 0;
  26. }