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