// -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 // // template struct variant_alternative; // undefined // template struct variant_alternative; // template struct variant_alternative; // template struct variant_alternative; // template // using variant_alternative_t = typename variant_alternative::type; // // template // struct variant_alternative>; #include #include #include #include "test_macros.h" #include "variant_test_helpers.hpp" template void test() { static_assert( std::is_same_v::type, E>, ""); static_assert( std::is_same_v::type, const E>, ""); static_assert( std::is_same_v::type, volatile E>, ""); static_assert( std::is_same_v< typename std::variant_alternative::type, const volatile E>, ""); static_assert(std::is_same_v, E>, ""); static_assert(std::is_same_v, const E>, ""); static_assert( std::is_same_v, volatile E>, ""); static_assert(std::is_same_v, const volatile E>, ""); } int main() { { using V = std::variant; test(); test(); test(); test(); } #if !defined(TEST_VARIANT_HAS_NO_REFERENCES) { using V = std::variant; test(); test(); test(); test(); test(); } #endif }