tuple_size.fail.cpp 1021 B

12345678910111213141516171819202122232425262728
  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>
  11. // class tuple_size<tuple<Types...>>
  12. // : public integral_constant<size_t, sizeof...(Types)> { };
  13. // Expect failures with a reference type, pointer type, and a non-tuple type.
  14. #include <tuple>
  15. int main(int, char**)
  16. {
  17. (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
  18. (void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
  19. (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
  20. return 0;
  21. }