variant_array.fail.cpp 936 B

123456789101112131415161718192021222324252627282930313233
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // The LLVM Compiler Infrastructure
  5. //
  6. // This file is dual licensed under the MIT and the University of Illinois Open
  7. // Source Licenses. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. // UNSUPPORTED: c++98, c++03, c++11, c++14
  11. // <variant>
  12. // template <class ...Types> class variant;
  13. #include <variant>
  14. #include <type_traits>
  15. #include <string>
  16. #include <cassert>
  17. #include "test_macros.h"
  18. #include "variant_test_helpers.hpp"
  19. #include "test_convertible.hpp"
  20. int main()
  21. {
  22. // expected-error@variant:* 3 {{static_assert failed}}
  23. std::variant<int, int[]> v; // expected-note {{requested here}}
  24. std::variant<int, int[42]> v2; // expected-note {{requested here}}
  25. std::variant<int, int[][42]> v3; // expected-note {{requested here}}
  26. }