1053859ffc67425a00915010f9df3c899119114d2Eric Fiselier//===----------------------------------------------------------------------===// 2053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// 3053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// The LLVM Compiler Infrastructure 4053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// 5053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// This file is dual licensed under the MIT and the University of Illinois Open 6053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// Source Licenses. See LICENSE.TXT for details. 7053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// 8053859ffc67425a00915010f9df3c899119114d2Eric Fiselier//===----------------------------------------------------------------------===// 9053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 10053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// <tuple> 11053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 12053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// template <class... Types> class tuple; 13053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 14053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// template <size_t I, class... Types> 15053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// class tuple_element<I, tuple<Types...> > 16053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// { 17053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// public: 18053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// typedef Ti type; 19053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// }; 20053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 21053859ffc67425a00915010f9df3c899119114d2Eric Fiselier// UNSUPPORTED: c++98, c++03 22053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 23053859ffc67425a00915010f9df3c899119114d2Eric Fiselier#include <tuple> 24053859ffc67425a00915010f9df3c899119114d2Eric Fiselier#include <type_traits> 25053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 26053859ffc67425a00915010f9df3c899119114d2Eric Fiselierint main() 27053859ffc67425a00915010f9df3c899119114d2Eric Fiselier{ 28053859ffc67425a00915010f9df3c899119114d2Eric Fiselier using T = std::tuple<int, long, void*>; 29053859ffc67425a00915010f9df3c899119114d2Eric Fiselier using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}} 30053859ffc67425a00915010f9df3c899119114d2Eric Fiselier using E2 = typename std::tuple_element<3, T>::type; 31053859ffc67425a00915010f9df3c899119114d2Eric Fiselier using E3 = typename std::tuple_element<4, T const>::type; 32053859ffc67425a00915010f9df3c899119114d2Eric Fiselier // expected-error@__tuple:* 2 {{static_assert failed}} 33053859ffc67425a00915010f9df3c899119114d2Eric Fiselier 34053859ffc67425a00915010f9df3c899119114d2Eric Fiselier} 35