]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
Vendor import of libc++ trunk r291012:
[FreeBSD/FreeBSD.git] / test / std / utilities / tuple / tuple.tuple / tuple.helper / tuple_size.fail.cpp
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
22 int main()
23 {
24     (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
25     (void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
26     (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
27 }