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