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 //===----------------------------------------------------------------------===//
8
9 // <tuple>
10
11 // template <class... Types> class tuple;
12
13 // template <size_t I, class... Types>
14 // struct tuple_element<I, tuple<Types...> >
15 // {
16 // typedef Ti type;
17 // };
18
19 // UNSUPPORTED: c++03
20
21 #include <tuple>
22 #include <type_traits>
23
main(int,char **)24 int main(int, char**)
25 {
26 using T = std::tuple<int, long, void*>;
27 using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
28 using E2 = typename std::tuple_element<3, T>::type;
29 using E3 = typename std::tuple_element<4, T const>::type;
30 // expected-error@__tuple:* 2 {{static_assert failed}}
31
32
33 return 0;
34 }
35