variant_empty.fail.cpp 689 B

1234567891011121314151617181920212223242526
  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 "test_macros.h"
  15. #include "variant_test_helpers.hpp"
  16. int main()
  17. {
  18. // expected-error@variant:* 1 {{static_assert failed}}
  19. std::variant<> v; // expected-note {{requested here}}
  20. }