Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / variant / variant.helpers / variant_alternative.verify.cpp
blob934d047338ba386aefcac206963cc3dc410a2c6a
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
11 // <variant>
13 // template <size_t I, class T> struct variant_alternative; // undefined
14 // template <size_t I, class T> struct variant_alternative<I, const T>;
15 // template <size_t I, class T> struct variant_alternative<I, volatile T>;
16 // template <size_t I, class T> struct variant_alternative<I, const volatile T>;
17 // template <size_t I, class T>
18 // using variant_alternative_t = typename variant_alternative<I, T>::type;
20 // template <size_t I, class... Types>
21 // struct variant_alternative<I, variant<Types...>>;
23 #include <memory>
24 #include <type_traits>
25 #include <variant>
27 int main(int, char**) {
28 using V = std::variant<int, void *, const void *, long double>;
29 std::variant_alternative<4, V>::type foo; // expected-error@variant:* {{Index out of bounds in std::variant_alternative<>}}
31 return 0;