110b9a1bbSEric Fiselier //===----------------------------------------------------------------------===//
210b9a1bbSEric Fiselier //
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
610b9a1bbSEric Fiselier //
710b9a1bbSEric Fiselier //===----------------------------------------------------------------------===//
810b9a1bbSEric Fiselier 
910b9a1bbSEric Fiselier // <tuple>
1010b9a1bbSEric Fiselier 
1110b9a1bbSEric Fiselier // template <class... Types> class tuple;
1210b9a1bbSEric Fiselier 
1310b9a1bbSEric Fiselier // template <size_t I, class... Types>
142b0c7abbSLouis Dionne // struct tuple_element<I, tuple<Types...> >
1510b9a1bbSEric Fiselier // {
1610b9a1bbSEric Fiselier //     typedef Ti type;
1710b9a1bbSEric Fiselier // };
1810b9a1bbSEric Fiselier 
1931cbe0f2SLouis Dionne // UNSUPPORTED: c++03
2010b9a1bbSEric Fiselier 
2110b9a1bbSEric Fiselier #include <tuple>
2210b9a1bbSEric Fiselier #include <type_traits>
2310b9a1bbSEric Fiselier 
main(int,char **)242df59c50SJF Bastien int main(int, char**)
2510b9a1bbSEric Fiselier {
2610b9a1bbSEric Fiselier     using T =  std::tuple<int, long, void*>;
2710b9a1bbSEric Fiselier     using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
2810b9a1bbSEric Fiselier     using E2 = typename std::tuple_element<3, T>::type;
2910b9a1bbSEric Fiselier     using E3 = typename std::tuple_element<4, T const>::type;
30*76476efdSMuhammad Usman Shahid         // expected-error-re@__tuple:* 2 {{{{(static_assert|static assertion)}} failed}}
3110b9a1bbSEric Fiselier 
322df59c50SJF Bastien 
332df59c50SJF Bastien   return 0;
3410b9a1bbSEric Fiselier }
35