xref: /llvm-project/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.verify.cpp (revision 9bb9ec380ace81d040d3a0a0a2ae9a75733ab330)
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 
23 using T =  std::tuple<int, long, void*>;
24 using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
25 using E2 = typename std::tuple_element<3, T>::type;
26 using E3 = typename std::tuple_element<4, T const>::type; // expected-error@*:* 2 {{static assertion failed}}
27