1f8c16417SMarshall Clow //===----------------------------------------------------------------------===//
2f8c16417SMarshall Clow //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6f8c16417SMarshall Clow //
7f8c16417SMarshall Clow //===----------------------------------------------------------------------===//
8f8c16417SMarshall Clow 
9*31cbe0f2SLouis Dionne // UNSUPPORTED: c++03, c++11, c++14
10f8c16417SMarshall Clow 
11f8c16417SMarshall Clow // <variant>
12f8c16417SMarshall Clow 
13f8c16417SMarshall Clow // template <size_t I, class T> struct variant_alternative; // undefined
14f8c16417SMarshall Clow // template <size_t I, class T> struct variant_alternative<I, const T>;
15f8c16417SMarshall Clow // template <size_t I, class T> struct variant_alternative<I, volatile T>;
16f8c16417SMarshall Clow // template <size_t I, class T> struct variant_alternative<I, const volatile T>;
17f8c16417SMarshall Clow // template <size_t I, class T>
18f8c16417SMarshall Clow //   using variant_alternative_t = typename variant_alternative<I, T>::type;
19f8c16417SMarshall Clow //
20f8c16417SMarshall Clow // template <size_t I, class... Types>
21f8c16417SMarshall Clow //    struct variant_alternative<I, variant<Types...>>;
22f8c16417SMarshall Clow 
23f8c16417SMarshall Clow #include <memory>
24f8c16417SMarshall Clow #include <type_traits>
25f8c16417SMarshall Clow #include <variant>
26f8c16417SMarshall Clow 
main(int,char **)272df59c50SJF Bastien int main(int, char**) {
28f8c16417SMarshall Clow     using V = std::variant<int, void *, const void *, long double>;
29b1543a67SRoger Ferrer Ibanez     std::variant_alternative<4, V>::type foo;  // expected-error@variant:* {{Index out of bounds in std::variant_alternative<>}}
302df59c50SJF Bastien 
312df59c50SJF Bastien   return 0;
32f8c16417SMarshall Clow }
33