monostate.pass.cpp 906 B

12345678910111213141516171819202122232425262728293031
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // UNSUPPORTED: c++98, c++03, c++11, c++14
  10. // <variant>
  11. // struct monostate {};
  12. #include <type_traits>
  13. #include <variant>
  14. #include "test_macros.h"
  15. int main(int, char**) {
  16. using M = std::monostate;
  17. static_assert(std::is_trivially_default_constructible<M>::value, "");
  18. static_assert(std::is_trivially_copy_constructible<M>::value, "");
  19. static_assert(std::is_trivially_copy_assignable<M>::value, "");
  20. static_assert(std::is_trivially_destructible<M>::value, "");
  21. constexpr M m{};
  22. ((void)m);
  23. return 0;
  24. }