Home | History | Annotate | Download | only in tuple.helper
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <tuple>
     11 
     12 // template <class... Types> class tuple;
     13 
     14 // template <size_t I, class... Types>
     15 // class tuple_element<I, tuple<Types...> >
     16 // {
     17 // public:
     18 //     typedef Ti type;
     19 // };
     20 
     21 // UNSUPPORTED: c++98, c++03
     22 
     23 #include <tuple>
     24 #include <type_traits>
     25 
     26 int main()
     27 {
     28     using T =  std::tuple<int, long, void*>;
     29     using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
     30     using E2 = typename std::tuple_element<3, T>::type;
     31     using E3 = typename std::tuple_element<4, T const>::type;
     32         // expected-error@__tuple:* 2 {{static_assert failed}}
     33 
     34 }
     35