1// { dg-options "-std=gnu++11" } 2// { dg-do compile } 3// 4// 2014-10-09 Ville Voutilainen <ville.voutilainen@gmail.com> 5// 6// Copyright (C) 2014-2015 Free Software Foundation, Inc. 7// 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) 12// any later version. 13// 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. 18// 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/>. 22 23#include <type_traits> 24#include <testsuite_tr1.h> 25 26struct HasTemplateCAssign 27{ 28 HasTemplateCAssign& operator=(const HasTemplateCAssign&) = default; 29 template <class T> 30 HasTemplateCAssign& operator=(T&&); 31}; 32 33struct MoveOnly 34{ 35 MoveOnly& operator=(MoveOnly&&) = default; 36}; 37 38struct MoveOnly2 39{ 40 MoveOnly2& operator=(MoveOnly2&&) = delete; 41}; 42 43void test01() 44{ 45 using std::is_trivially_move_assignable; 46 using namespace __gnu_test; 47 48 static_assert(test_property<is_trivially_move_assignable, 49 int>(true), ""); 50 static_assert(test_property<is_trivially_move_assignable, 51 TType>(true), ""); 52 static_assert(test_property<is_trivially_move_assignable, 53 PODType>(true), ""); 54 static_assert(test_property<is_trivially_move_assignable, 55 NType>(false), ""); 56 static_assert(test_property<is_trivially_move_assignable, 57 SLType>(true), ""); 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, 89 MoveOnly>(true), ""); 90 static_assert(test_property<is_trivially_move_assignable, 91 MoveOnly2>(false), ""); 92} 93