// -*- 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 // constexpr bool holds_alternative(const variant& v) noexcept; #include "test_macros.h" #include int main() { { using V = std::variant; constexpr V v; static_assert(std::holds_alternative(v), ""); } { using V = std::variant; constexpr V v; static_assert(std::holds_alternative(v), ""); static_assert(!std::holds_alternative(v), ""); } { // noexcept test using V = std::variant; const V v; ASSERT_NOEXCEPT(std::holds_alternative(v)); } }