tuple_array_template_depth.pass.cpp 983 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "test_macros.h"
  18. // Use 1256 to try and blow the template instantiation depth for all compilers.
  19. typedef std::array<char, 1256> array_t;
  20. typedef std::tuple<array_t> tuple_t;
  21. int main(int, char**)
  22. {
  23. array_t arr;
  24. tuple_t tup;
  25. tup = arr;
  26. return 0;
  27. }