From patchwork Wed Oct 8 20:28:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ville Voutilainen X-Patchwork-Id: 397721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 996B21400A0 for ; Thu, 9 Oct 2014 07:28:57 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=Uht45Cwm1R7LdCG8THHJ5VMJMhLcZTz71tP6SwL01E5hNT 8MwwE0N6OgPbB8zWO+zawcDPHm/3lcNBsWTcbDTNJuURFtmZJHjfABZkONt9bm6R WC6yHfkT3HRCwQkkPjm0O2F/eD6bKh1+XM64mx+Vk5ZqMWLJ1nnItIqr1wS5o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=WmBiY0WQktMEbDo8lXhzhdqQWJY=; b=r0VdEZEZio/72ozlL33P 10HuJ7jJYZIWFV2N3LtciDaGYJoRRJTSQD1BkIkTOwlBNi/EOS+AUokWIcu973Hu OGRRJsT3hUuvoUkGhFpaVMnUYIJ75ehgXzZkD+RueLLOzWhvjdqlUBS43ing8kfx F5cMo3P+vl7pNX7Q05ZKqcE= Received: (qmail 5100 invoked by alias); 8 Oct 2014 20:28:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5081 invoked by uid 89); 8 Oct 2014 20:28:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 08 Oct 2014 20:28:28 +0000 Received: by mail-oi0-f53.google.com with SMTP id v63so8626166oia.26 for ; Wed, 08 Oct 2014 13:28:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.58.36 with SMTP id n4mr15809434oeq.73.1412800105425; Wed, 08 Oct 2014 13:28:25 -0700 (PDT) Received: by 10.76.24.198 with HTTP; Wed, 8 Oct 2014 13:28:25 -0700 (PDT) Date: Wed, 8 Oct 2014 23:28:25 +0300 Message-ID: Subject: [PATCH] PR libstdc++/60132, implement the remaining C++11 is_trivially_* traits From: Ville Voutilainen To: "gcc-patches@gcc.gnu.org" , libstdc++@gcc.gnu.org Tested on Linux-X64. Massive thanks to Jason for doing the heavy lifting on the front-end side. 2014-10-08 Ville Voutilainen PR libstdc++/60132 * include/std/type_traits (is_trivially_copyable, is_trivially_constructible, is_trivially_default_constructible, is_trivially_copy_constructible, is_trivially_move_constructible, is_trivially_assignable, is_trivially_copy_assignable, is_trivially_move_assignable): New. * testsuite/20_util/is_trivially_assignable/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_assignable/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_assignable/value.cc: New. * testsuite/20_util/is_trivially_constructible/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_constructible/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_constructible/value.cc: New. * testsuite/20_util/is_trivially_copyable/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_copyable/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_copyable/value.cc: New. * testsuite/20_util/is_trivially_copy_assignable/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_copy_assignable/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_copy_assignable/value.cc: New. * testsuite/20_util/is_trivially_copy_constructible/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_copy_constructible/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_copy_constructible/value.cc: New. * testsuite/20_util/is_trivially_default_constructible/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_default_constructible/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_default_constructible/value.cc: New. * testsuite/20_util/is_trivially_move_assignable/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_move_assignable/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_move_assignable/value.cc: New. * testsuite/20_util/is_trivially_move_constructible/requirements/typedefs.cc: New. * testsuite/20_util/is_trivially_move_constructible/requirements/explicit_instantiation.cc: New. * testsuite/20_util/is_trivially_move_constructible/value.cc: New. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 6690044..d776efe 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -606,7 +606,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public integral_constant { }; - // is_trivially_copyable (still unimplemented) + // is_trivially_copyable + template + struct is_trivially_copyable + : public integral_constant + { }; /// is_standard_layout template @@ -1282,19 +1286,58 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __is_nt_move_assignable_impl<_Tp> { }; - /// is_trivially_constructible (still unimplemented) + /// is_trivially_constructible + template + struct is_trivially_constructible + : public __and_, integral_constant>::type + { }; - /// is_trivially_default_constructible (still unimplemented) - - /// is_trivially_copy_constructible (still unimplemented) + /// is_trivially_default_constructible + template + struct is_trivially_default_constructible + : public is_trivially_constructible<_Tp>::type + { }; - /// is_trivially_move_constructible (still unimplemented) + /// is_trivially_copy_constructible + template + struct is_trivially_copy_constructible + : public __and_, + integral_constant>::type + { }; + + /// is_trivially_move_constructible + template + struct is_trivially_move_constructible + : public __and_, + integral_constant>::type + { }; - /// is_trivially_assignable (still unimplemented) + /// is_trivially_assignable + template + struct is_trivially_assignable + : public __and_, + integral_constant>::type + { }; - /// is_trivially_copy_assignable (still unimplemented) + /// is_trivially_copy_assignable + template + struct is_trivially_copy_assignable + : public __and_, + integral_constant>::type + { }; - /// is_trivially_move_assignable (still unimplemented) + /// is_trivially_move_assignable + template + struct is_trivially_move_assignable + : public __and_, + integral_constant>::type + { }; /// is_trivially_destructible template diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..cc028ad --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/typedefs.cc new file mode 100644 index 0000000..44c8acd --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/value.cc new file mode 100644 index 0000000..34290c5 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_assignable/value.cc @@ -0,0 +1,135 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCAssign +{ + HasTemplateCAssign& operator=(const HasTemplateCAssign&) = default; + template + HasTemplateCAssign& operator=(T&&); +}; + +struct MoveOnly +{ + MoveOnly& operator=(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2& operator=(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_assignable; + using namespace __gnu_test; + + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..4fb6ef0 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/typedefs.cc new file mode 100644 index 0000000..73c18c0 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_constructible test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc new file mode 100644 index 0000000..df092dc --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc @@ -0,0 +1,168 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCCtor +{ + HasTemplateCCtor(const HasTemplateCCtor&) = default; + template + HasTemplateCCtor(T&&); +}; + +struct MoveOnly +{ + MoveOnly(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_constructible; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + + +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..2cd2a9c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_copy_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/typedefs.cc new file mode 100644 index 0000000..ee59a20 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_copy_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/value.cc new file mode 100644 index 0000000..a037551 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_assignable/value.cc @@ -0,0 +1,92 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCAssign +{ + HasTemplateCAssign& operator=(const HasTemplateCAssign&) = default; + template + HasTemplateCAssign& operator=(T&&); +}; + +struct MoveOnly +{ + MoveOnly& operator=(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2& operator=(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_copy_assignable; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..0057488 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_copy_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/typedefs.cc new file mode 100644 index 0000000..a5cc46a --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_copy_constructible test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/value.cc new file mode 100644 index 0000000..2782517 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copy_constructible/value.cc @@ -0,0 +1,86 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCCtor +{ + HasTemplateCCtor(const HasTemplateCCtor&) = default; + template + HasTemplateCCtor(T&&); +}; + +struct MoveOnly +{ + MoveOnly(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_copy_constructible; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..c5d94f8 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_copyable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/typedefs.cc new file mode 100644 index 0000000..f2982c9 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_copyable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_copyable/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/value.cc new file mode 100644 index 0000000..a124612 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_copyable/value.cc @@ -0,0 +1,86 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCCtor +{ + HasTemplateCCtor(const HasTemplateCCtor&) = default; + template + HasTemplateCCtor(T&&); +}; + +struct MoveOnly +{ + MoveOnly(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_copyable; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..a512ec6 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_default_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/typedefs.cc new file mode 100644 index 0000000..525b137 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_default_constructible test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/value.cc new file mode 100644 index 0000000..e06a9d6 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/value.cc @@ -0,0 +1,66 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCtor +{ + HasTemplateCtor() = default; + template + HasTemplateCtor(); +}; + +void test01() +{ + using std::is_trivially_default_constructible; + using namespace __gnu_test; + + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..ff04e5b --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_move_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/typedefs.cc new file mode 100644 index 0000000..1209578 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_move_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/value.cc new file mode 100644 index 0000000..84491e8 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_assignable/value.cc @@ -0,0 +1,92 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCAssign +{ + HasTemplateCAssign& operator=(const HasTemplateCAssign&) = default; + template + HasTemplateCAssign& operator=(T&&); +}; + +struct MoveOnly +{ + MoveOnly& operator=(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2& operator=(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_move_assignable; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 0000000..4ea4850 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2012-2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_trivially_move_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/typedefs.cc new file mode 100644 index 0000000..4fb6e7d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=c++11" } +// +// 2014-10-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_trivially_move_constructible test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/value.cc new file mode 100644 index 0000000..7078830 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_trivially_move_constructible/value.cc @@ -0,0 +1,86 @@ +// { dg-options "-std=c++11" } +// { dg-do compile } +// +// 2014-010-07 Ville Voutilainen +// +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +struct HasTemplateCCtor +{ + HasTemplateCCtor(const HasTemplateCCtor&) = default; + template + HasTemplateCCtor(T&&); +}; + +struct MoveOnly +{ + MoveOnly(MoveOnly&&) = default; +}; + +struct MoveOnly2 +{ + MoveOnly2(MoveOnly2&&) = delete; +}; + +void test01() +{ + using std::is_trivially_move_constructible; + using namespace __gnu_test; + + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); + static_assert(test_property(true), ""); + static_assert(test_property(false), ""); +}