empty_member.pass.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <tuple>
  10. // template <class... Types> class tuple;
  11. // UNSUPPORTED: c++98, c++03
  12. // This is not a portable test
  13. #include <tuple>
  14. struct A {};
  15. struct B {};
  16. int main()
  17. {
  18. {
  19. typedef std::tuple<int, A> T;
  20. static_assert((sizeof(T) == sizeof(int)), "");
  21. }
  22. {
  23. typedef std::tuple<A, int> T;
  24. static_assert((sizeof(T) == sizeof(int)), "");
  25. }
  26. {
  27. typedef std::tuple<A, int, B> T;
  28. static_assert((sizeof(T) == sizeof(int)), "");
  29. }
  30. {
  31. typedef std::tuple<A, B, int> T;
  32. static_assert((sizeof(T) == sizeof(int)), "");
  33. }
  34. {
  35. typedef std::tuple<int, A, B> T;
  36. static_assert((sizeof(T) == sizeof(int)), "");
  37. }
  38. }