1 // { dg-options "-std=gnu++11" }
4 // 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com>
6 // Copyright (C) 2014 Free Software Foundation, Inc.
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
23 #include <type_traits>
24 #include <testsuite_tr1.h>
26 struct HasTemplateCAssign
28 HasTemplateCAssign
& operator=(const HasTemplateCAssign
&) = default;
30 HasTemplateCAssign
& operator=(T
&&);
35 MoveOnly
& operator=(MoveOnly
&&) = default;
40 MoveOnly2
& operator=(MoveOnly2
&&) = delete;
45 using std::is_trivially_move_assignable
;
46 using namespace __gnu_test
;
48 static_assert(test_property
<is_trivially_move_assignable
,
50 static_assert(test_property
<is_trivially_move_assignable
,
52 static_assert(test_property
<is_trivially_move_assignable
,
54 static_assert(test_property
<is_trivially_move_assignable
,
56 static_assert(test_property
<is_trivially_move_assignable
,
58 static_assert(test_property
<is_trivially_move_assignable
,
59 assign::Empty
>(true), "");
60 static_assert(test_property
<is_trivially_move_assignable
,
61 assign::Abstract
>(false), "");
62 static_assert(test_property
<is_trivially_move_assignable
,
63 assign::Ellipsis
>(true), "");
64 static_assert(test_property
<is_trivially_move_assignable
,
65 assign::DelEllipsis
>(true), "");
66 static_assert(test_property
<is_trivially_move_assignable
,
67 assign::Any
>(true), "");
68 static_assert(test_property
<is_trivially_move_assignable
,
69 assign::DelDef
>(true), "");
70 static_assert(test_property
<is_trivially_move_assignable
,
71 assign::DelCopy
>(true), "");
72 static_assert(test_property
<is_trivially_move_assignable
,
73 assign::Nontrivial
>(false), "");
74 static_assert(test_property
<is_trivially_move_assignable
,
75 assign::AnyAssign
>(true), "");
76 static_assert(test_property
<is_trivially_move_assignable
,
77 assign::DelAnyAssign
>(true), "");
78 static_assert(test_property
<is_trivially_move_assignable
,
79 assign::DelCopyAssign
>(true), "");
80 static_assert(test_property
<is_trivially_move_assignable
,
81 assign::MO
>(true), "");
82 static_assert(test_property
<is_trivially_move_assignable
,
83 CopyConsOnlyType
>(false), "");
84 static_assert(test_property
<is_trivially_move_assignable
,
85 MoveConsOnlyType
>(false), "");
86 static_assert(test_property
<is_trivially_move_assignable
,
87 HasTemplateCAssign
>(false), "");
88 static_assert(test_property
<is_trivially_move_assignable
,
90 static_assert(test_property
<is_trivially_move_assignable
,
91 MoveOnly2
>(false), "");