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 HasTemplateCCtor 27{ 28 HasTemplateCCtor(const HasTemplateCCtor&) = default; 29 template <class T> 30 HasTemplateCCtor(T&&); 31}; 32 33struct MoveOnly 34{ 35 MoveOnly(MoveOnly&&) = default; 36}; 37 38struct MoveOnly2 39{ 40 MoveOnly2(MoveOnly2&&) = delete; 41}; 42 43void test01() 44{ 45 using std::is_trivially_copyable; 46 using namespace __gnu_test; 47 48 static_assert(test_property<is_trivially_copyable, 49 int>(true), ""); 50 static_assert(test_property<is_trivially_copyable, 51 volatile int>(false), ""); 52 static_assert(test_property<is_trivially_copyable, 53 TType>(true), ""); 54 static_assert(test_property<is_trivially_copyable, 55 PODType>(true), ""); 56 static_assert(test_property<is_trivially_copyable, 57 NType>(false), ""); 58 static_assert(test_property<is_trivially_copyable, 59 SLType>(false), ""); 60 static_assert(test_property<is_trivially_copyable, 61 construct::DelDef>(true), ""); 62 static_assert(test_property<is_trivially_copyable, 63 construct::Abstract>(false), ""); 64 static_assert(test_property<is_trivially_copyable, 65 construct::Ellipsis>(true), ""); 66 static_assert(test_property<is_trivially_copyable, 67 construct::DelEllipsis>(true), ""); 68 static_assert(test_property<is_trivially_copyable, 69 construct::Any>(true), ""); 70 static_assert(test_property<is_trivially_copyable, 71 construct::DelCopy>(true), ""); 72 static_assert(test_property<is_trivially_copyable, 73 construct::DelDtor>(true), ""); 74 static_assert(test_property<is_trivially_copyable, 75 construct::Nontrivial>(false), ""); 76 static_assert(test_property<is_trivially_copyable, 77 construct::UnusualCopy>(false), ""); 78 static_assert(test_property<is_trivially_copyable, 79 CopyConsOnlyType>(true), ""); 80 static_assert(test_property<is_trivially_copyable, 81 MoveConsOnlyType>(true), ""); 82 static_assert(test_property<is_trivially_copyable, 83 HasTemplateCCtor>(true), ""); 84 static_assert(test_property<is_trivially_copyable, 85 MoveOnly>(true), ""); 86 static_assert(test_property<is_trivially_copyable, 87 MoveOnly2>(true), ""); 88} 89