tuple_size.fail.cpp revision f9a20c2c382ce58c2330fb799203bfc044569d4b
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// UNSUPPORTED: c++98, c++03
11
12// <tuple>
13
14// template <class... Types>
15//   class tuple_size<tuple<Types...>>
16//     : public integral_constant<size_t, sizeof...(Types)> { };
17
18// Expect failures with a reference type, pointer type, and a non-tuple type.
19
20#include <tuple>
21
22int main()
23{
24    (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{no member named 'value'}}
25    (void)std::tuple_size<int>::value; // expected-error {{no member named 'value'}}
26    (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{no member named 'value'}}
27}
28