]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/20_util/tuple/creation_functions/constexpr.cc
47f3e3f6f0990cca3af56742da5408c56a7acfe9
2 // { dg-options "-std=gnu++0x" }
4 // Copyright (C) 2011-2014 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
22 // NOTE: This makes use of the fact that we know how moveable
23 // is implemented on pair, and also vector. If the implementation
24 // changes this test may begin to fail.
28 bool test
__attribute__((unused
)) = true;
36 typedef std::tuple
<int, float> tuple_type
;
37 constexpr tuple_type p1
__attribute__((unused
))
38 = std::make_tuple(22, 22.222);
42 typedef std::tuple
<int, float, int> tuple_type
;
43 constexpr tuple_type p1
__attribute__((unused
))
44 = std::make_tuple(22, 22.222, 77799);
51 test_forward_as_tuple()
54 typedef std::tuple
<int, float> tuple_type
;
55 constexpr tuple_type p1
__attribute__((unused
))
56 = std::forward_as_tuple(22, 22.222);
60 typedef std::tuple
<int, float, int> tuple_type
;
61 constexpr tuple_type p1
__attribute__((unused
))
62 = std::forward_as_tuple(22, 22.222, 77799);
75 typedef std::tuple
<int, float> tuple_type
;
76 constexpr tuple_type p1
__attribute__((unused
))
85 typedef std::tuple
<int, float, int> tuple_type
;
86 constexpr tuple_type p1
__attribute__((unused
))
97 typedef std::tuple
<int, float> tuple_type
;
98 constexpr tuple_type t1
{ 55, 77.77 };
99 constexpr auto var
__attribute__((unused
))
104 typedef std::tuple
<int, float, int> tuple_type
;
105 constexpr tuple_type t1
{ 55, 77.77, 99 };
106 constexpr auto var
__attribute__((unused
))
115 typedef std::tuple
<int, float> tuple_type1
;
116 typedef std::tuple
<int, int, float> tuple_type2
;
118 constexpr tuple_type1 t1
{ 55, 77.77 };
119 constexpr tuple_type2 t2
{ 55, 99, 77.77 };
120 constexpr auto cat1
__attribute__((unused
)) = std::tuple_cat(t1
, t2
);