// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: 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.h" 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(int, char**) { { 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 return 0; }