]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/20_util/tuple/cons/nested_tuple_construct.cc
1 // { dg-do run { target c++11 } }
3 // Copyright (C) 2015-2024 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
22 #include <testsuite_hooks.h>
24 static std::string result
;
27 int state
; // this has to be here
49 std::tuple
<std::tuple
<X
>&&> t2
{std::move(t1
)};
50 std::tuple
<std::tuple
<X
>> t3
{std::move(t2
)};
56 std::tuple
<X
> t1
{std::move(v
)};
57 std::tuple
<std::tuple
<X
>&&> t2
{std::move(t1
)};
58 std::tuple
<std::tuple
<X
>> t3
{std::move(t2
)};
63 std::tuple
<X
> t1
{X
{}};
64 std::tuple
<std::tuple
<X
>&&> t2
{std::move(t1
)};
65 std::tuple
<std::tuple
<X
>> t3
{std::move(t2
)};
72 std::tuple
<X
> t1
{std::allocator_arg
, a
, v
};
73 std::tuple
<std::tuple
<X
>&&> t2
{std::allocator_arg
, a
, std::move(t1
)};
74 std::tuple
<std::tuple
<X
>> t3
{std::allocator_arg
, a
, std::move(t2
)};
81 std::tuple
<X
> t1
{std::allocator_arg
, a
, std::move(v
)};
82 std::tuple
<std::tuple
<X
>&&> t2
{std::allocator_arg
, a
, std::move(t1
)};
83 std::tuple
<std::tuple
<X
>> t3
{std::allocator_arg
, a
, std::move(t2
)};
89 std::tuple
<X
> t1
{std::allocator_arg
, a
, X
{}};
90 std::tuple
<std::tuple
<X
>&&> t2
{std::allocator_arg
, a
, std::move(t1
)};
91 std::tuple
<std::tuple
<X
>> t3
{std::allocator_arg
, a
, std::move(t2
)};
97 VERIFY(result
== "DefCopyMoveDtorDtorDtor");
100 VERIFY(result
== "DefMoveMoveDtorDtorDtor");
103 VERIFY(result
== "DefMoveDtorMoveDtorDtor");
106 VERIFY(result
== "DefCopyMoveDtorDtorDtor");
109 VERIFY(result
== "DefMoveMoveDtorDtorDtor");
112 VERIFY(result
== "DefMoveDtorMoveDtorDtor");