From patchwork Sun Dec 8 09:42:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 298780 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4DAB92C00D5 for ; Sun, 8 Dec 2013 20:43:26 +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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=RU8wLrD1u4pMvFIvjf39HqjDrYWvW8LR8gcAtvjDqAA ybi0qCpVRULJxlBOezflbSt7X7R0sFw46t4IRp/tQGfqIc9eV8fGAVXQSh6Mz9gz /kAau05bBedBcXftb2QIoJUlhNwVw3hr2nstFe7E9st7RXcdRZq16MqlVau4zu7I = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=0G2RnKAw9rWB8PCKO4FB2Fd5SHc=; b=EhsibJhUNlwEbutLx MiPVpZbIHHgeNB2FyU6QG7/PVNNkAuGm14Vgs/m6rd/bUog53cO6ap1F8kFaxE56 hMJZElGbjpC3R2qTcSDzvEZK9xkbpxQW3QYK8w2xziXxAiedNDDEQBqrLMDG5R+H G/eoz05ADWRBM+n0nW7IndGkzI= Received: (qmail 13535 invoked by alias); 8 Dec 2013 09:43:16 -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 13513 invoked by uid 89); 8 Dec 2013 09:43:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: aserp1040.oracle.com Received: from Unknown (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 08 Dec 2013 09:43:05 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rB89gtij028174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Dec 2013 09:42:56 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rB89gtms026693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Dec 2013 09:42:55 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rB89gtLb005130; Sun, 8 Dec 2013 09:42:55 GMT Received: from [192.168.1.4] (/79.36.196.159) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 08 Dec 2013 01:42:53 -0800 Message-ID: <52A43F1B.9030707@oracle.com> Date: Sun, 08 Dec 2013 10:42:51 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] Add some std::type_traits tests X-IsSubscribed: yes Hi, this adds long overdue minimal testing of std::type_traits features which used to share code with std::tr1::type_traits. Tested x86_64-linux. Thanks, Paolo. /////////////////// 2013-12-08 Paolo Carlini * testsuite/20_util/add_const/requirements/explicit_instantiation.cc: New. * testsuite/20_util/add_const/value.cc: Likewise. * testsuite/20_util/add_cv/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/add_cv/value.cc: Likewise. * testsuite/20_util/add_pointer/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/add_pointer/value.cc: Likewise. * testsuite/20_util/add_volatile/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/add_volatile/value.cc: Likewise. * testsuite/20_util/alignment_of/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/alignment_of/requirements/typedefs.cc: Likewise. * testsuite/20_util/alignment_of/value.cc: Likewise. * testsuite/20_util/extent/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/extent/requirements/typedefs.cc: Likewise. * testsuite/20_util/extent/value.cc: Likewise. * testsuite/20_util/has_virtual_destructor/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/has_virtual_destructor/requirements/ typedefs.cc: Likewise. * testsuite/20_util/has_virtual_destructor/value.cc: Likewise. * testsuite/20_util/is_abstract/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_abstract/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_abstract/value.cc: Likewise. * testsuite/20_util/is_arithmetic/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_arithmetic/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_arithmetic/value.cc: Likewise. * testsuite/20_util/is_array/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_array/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_array/value.cc: Likewise. * testsuite/20_util/is_base_of/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_base_of/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_base_of/value.cc: Likewise. * testsuite/20_util/is_class/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_class/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_class/value.cc: Likewise. * testsuite/20_util/is_const/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_const/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_const/value.cc: Likewise. * testsuite/20_util/is_empty/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_empty/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_empty/value.cc: Likewise. * testsuite/20_util/is_enum/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_enum/requirements/typedefs.cc * testsuite/20_util/is_enum/value.cc: Likewise. * testsuite/20_util/is_pointer/requirements/explicit_instantiation.cc * testsuite/20_util/is_pointer/value.cc: Likewise. * testsuite/20_util/is_polymorphic/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_polymorphic/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_polymorphic/value.cc: Likewise. * testsuite/20_util/is_same/requirements/explicit_instantiation.cc * testsuite/20_util/is_same/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_same/value.cc: Likewise. * testsuite/20_util/is_union/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_union/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_union/value.cc: Likewise. * testsuite/20_util/is_void/requirements/explicit_instantiation.cc * testsuite/20_util/is_void/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_void/value.cc: Likewise. * testsuite/20_util/is_volatile/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_volatile/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_volatile/value.cc: Likewise. * testsuite/20_util/rank/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/rank/requirements/typedefs.cc: Likewise. * testsuite/20_util/rank/value.cc: Likewise. * testsuite/20_util/remove_all_extents/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_all_extents/value.cc: Likewise. * testsuite/20_util/remove_const/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_const/value.cc: Likewise. * testsuite/20_util/remove_cv/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_cv/value.cc: Likewise. * testsuite/20_util/remove_extent/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_extent/value.cc: Likewise. * testsuite/20_util/remove_pointer/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_pointer/value.cc: Likewise. * testsuite/20_util/remove_volatile/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/remove_volatile/value.cc: Likewise. Index: testsuite/20_util/add_const/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/add_const/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/add_const/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 add_const; +} Index: testsuite/20_util/add_const/value.cc =================================================================== --- testsuite/20_util/add_const/value.cc (revision 0) +++ testsuite/20_util/add_const/value.cc (working copy) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::add_const; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, const int>::value, ""); + static_assert(is_same::type, + const volatile int>::value, ""); + static_assert(is_same::type, int* const>::value, ""); + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, int (int)>::value, ""); + static_assert(is_same::type, const int>::value, ""); + static_assert(is_same::type, + const ClassType>::value, ""); + static_assert(is_same::type, + const volatile ClassType>::value, ""); + static_assert(is_same::type, + ClassType* const>::value, ""); + static_assert(is_same::type, ClassType&>::value, ""); + static_assert(is_same::type, + ClassType (ClassType)>::value, ""); + static_assert(is_same::type, + const ClassType>::value, ""); +} Index: testsuite/20_util/add_cv/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/add_cv/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/add_cv/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 add_cv; +} Index: testsuite/20_util/add_cv/value.cc =================================================================== --- testsuite/20_util/add_cv/value.cc (revision 0) +++ testsuite/20_util/add_cv/value.cc (working copy) @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::add_cv; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, const volatile int>::value, ""); + static_assert(is_same::type, + const volatile int>::value, ""); + static_assert(is_same::type, int* const volatile>::value, ""); + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, int (int)>::value, ""); + static_assert(is_same::type, + const volatile int>::value, ""); + static_assert(is_same::type, + const volatile ClassType>::value, ""); + static_assert(is_same::type, + const volatile ClassType>::value, ""); + static_assert(is_same::type, + ClassType* const volatile>::value, ""); + static_assert(is_same::type, ClassType&>::value, ""); + static_assert(is_same::type, + ClassType (ClassType)>::value, ""); + static_assert(is_same::type, + const volatile ClassType>::value, ""); +} Index: testsuite/20_util/add_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/add_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/add_pointer/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 add_pointer; +} Index: testsuite/20_util/add_pointer/value.cc =================================================================== --- testsuite/20_util/add_pointer/value.cc (revision 0) +++ testsuite/20_util/add_pointer/value.cc (working copy) @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::add_pointer; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, int*>::value, ""); + static_assert(is_same::type, int**>::value, ""); + static_assert(is_same::type, const int*>::value, ""); + static_assert(is_same::type, int*>::value, ""); + static_assert(is_same::type, + ClassType**>::value, ""); + static_assert(is_same::type, ClassType*>::value, ""); +} Index: testsuite/20_util/add_volatile/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/add_volatile/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/add_volatile/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 add_volatile; +} Index: testsuite/20_util/add_volatile/value.cc =================================================================== --- testsuite/20_util/add_volatile/value.cc (revision 0) +++ testsuite/20_util/add_volatile/value.cc (working copy) @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::add_volatile; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, volatile int>::value, ""); + static_assert(is_same::type, + const volatile int>::value, ""); + static_assert(is_same::type, int* volatile>::value, ""); + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, int (int)>::value, ""); + static_assert(is_same::type, + volatile int>::value, ""); + static_assert(is_same::type, + volatile ClassType>::value, ""); + static_assert(is_same::type, + const volatile ClassType>::value, ""); + static_assert(is_same::type, + ClassType* volatile>::value, ""); + static_assert(is_same::type, ClassType&>::value, ""); + static_assert(is_same::type, + ClassType (ClassType)>::value, ""); + static_assert(is_same::type, + volatile ClassType>::value, ""); +} Index: testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 alignment_of; +} Index: testsuite/20_util/alignment_of/requirements/typedefs.cc =================================================================== --- testsuite/20_util/alignment_of/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/alignment_of/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::alignment_of 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; +} Index: testsuite/20_util/alignment_of/value.cc =================================================================== --- testsuite/20_util/alignment_of/value.cc (revision 0) +++ testsuite/20_util/alignment_of/value.cc (working copy) @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::alignment_of; + using namespace __gnu_test; + + static_assert(test_property(__alignof__(char)), ""); + static_assert(test_property(__alignof__(short)), ""); + static_assert(test_property(__alignof__(int)), ""); + static_assert(test_property(__alignof__(double)), ""); + static_assert(test_property(__alignof__(int[4])), ""); + static_assert(test_property(__alignof__(ClassType)), ""); +} Index: testsuite/20_util/extent/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/extent/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/extent/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 extent; +} Index: testsuite/20_util/extent/requirements/typedefs.cc =================================================================== --- testsuite/20_util/extent/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/extent/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::extent 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; +} Index: testsuite/20_util/extent/value.cc =================================================================== --- testsuite/20_util/extent/value.cc (revision 0) +++ testsuite/20_util/extent/value.cc (working copy) @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::extent; + using namespace __gnu_test; + + static_assert(test_property(0), ""); + static_assert(test_property(2), ""); + static_assert(test_property(2), ""); + static_assert(test_property(0), ""); + static_assert(extent::value == 0, ""); + static_assert(extent::value == 0, ""); + static_assert(extent::value == 4, ""); + static_assert(extent::value == 4, ""); + static_assert(extent::value == 12, ""); + static_assert(test_property(0), ""); + static_assert(test_property(2), ""); + static_assert(test_property(2), ""); + static_assert(test_property(0), ""); + static_assert(extent::value == 0, ""); + static_assert(extent::value == 0, ""); + static_assert(extent::value == 4, ""); + static_assert(extent::value == 4, ""); + static_assert(extent::value == 12, ""); +} Index: testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 has_virtual_destructor; +} Index: testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc =================================================================== --- testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::has_virtual_destructor 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; +} Index: testsuite/20_util/has_virtual_destructor/value.cc =================================================================== --- testsuite/20_util/has_virtual_destructor/value.cc (revision 0) +++ testsuite/20_util/has_virtual_destructor/value.cc (working copy) @@ -0,0 +1,50 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 +#include + +void test01() +{ + using std::has_virtual_destructor; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Negative tests. + 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), ""); +} Index: testsuite/20_util/is_abstract/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_abstract/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_abstract/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_abstract; +} Index: testsuite/20_util/is_abstract/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_abstract/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_abstract/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_abstract 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; +} Index: testsuite/20_util/is_abstract/value.cc =================================================================== --- testsuite/20_util/is_abstract/value.cc (revision 0) +++ testsuite/20_util/is_abstract/value.cc (working copy) @@ -0,0 +1,39 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_abstract; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + + // Negative tests. + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_arithmetic/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_arithmetic/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_arithmetic/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_arithmetic; +} Index: testsuite/20_util/is_arithmetic/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_arithmetic/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_arithmetic/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_arithmetic 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; +} Index: testsuite/20_util/is_arithmetic/value.cc =================================================================== --- testsuite/20_util/is_arithmetic/value.cc (revision 0) +++ testsuite/20_util/is_arithmetic/value.cc (working copy) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_arithmetic; + using namespace __gnu_test; + + static_assert(test_category(false), ""); + + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); +#ifdef _GLIBCXX_USE_WCHAR_T + static_assert(test_category(true), ""); +#endif + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_array/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_array/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_array/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_array; +} Index: testsuite/20_util/is_array/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_array/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_array/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_array 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; +} Index: testsuite/20_util/is_array/value.cc =================================================================== --- testsuite/20_util/is_array/value.cc (revision 0) +++ testsuite/20_util/is_array/value.cc (working copy) @@ -0,0 +1,44 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_array; + using namespace __gnu_test; + + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_base_of/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_base_of/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_base_of/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_base_of; +} Index: testsuite/20_util/is_base_of/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_base_of/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_base_of/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_base_of 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; +} Index: testsuite/20_util/is_base_of/value.cc =================================================================== --- testsuite/20_util/is_base_of/value.cc (revision 0) +++ testsuite/20_util/is_base_of/value.cc (working copy) @@ -0,0 +1,89 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +class HiddenCons +{ + HiddenCons(); + HiddenCons(const HiddenCons&); +}; + +class DerivedHiddenCons +: private HiddenCons +{ + DerivedHiddenCons(); + DerivedHiddenCons(const DerivedHiddenCons&); +}; + +class MultiDerivedHiddenCons +: private HiddenCons, private __gnu_test::ClassType +{ + MultiDerivedHiddenCons(); + MultiDerivedHiddenCons(const MultiDerivedHiddenCons&); +}; + +void test01() +{ + using std::is_base_of; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + + // Negative tests. + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); +} Index: testsuite/20_util/is_class/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_class/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_class/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_class; +} Index: testsuite/20_util/is_class/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_class/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_class/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_class 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; +} Index: testsuite/20_util/is_class/value.cc =================================================================== --- testsuite/20_util/is_class/value.cc (revision 0) +++ testsuite/20_util/is_class/value.cc (working copy) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_class; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Negative tests. + 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(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_const/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_const/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_const/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_const; +} Index: testsuite/20_util/is_const/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_const/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_const/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_const 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; +} Index: testsuite/20_util/is_const/value.cc =================================================================== --- testsuite/20_util/is_const/value.cc (revision 0) +++ testsuite/20_util/is_const/value.cc (working copy) @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_const; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + + // Negative tests. + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); +} Index: testsuite/20_util/is_empty/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_empty/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_empty/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_empty; +} Index: testsuite/20_util/is_empty/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_empty/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_empty/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_empty 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; +} Index: testsuite/20_util/is_empty/value.cc =================================================================== --- testsuite/20_util/is_empty/value.cc (revision 0) +++ testsuite/20_util/is_empty/value.cc (working copy) @@ -0,0 +1,66 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +class EmptyClassOne +{ typedef int type; }; + +class EmptyClassTwo +{ static int data; }; + +class EmptyClassThree +{ int f(); }; + +class NonEmptyClassOne +{ int data; }; + +class NonEmptyClassTwo +{ + virtual int f(); + virtual ~NonEmptyClassTwo(); +}; + +void test01() +{ + using std::is_empty; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Negative tests. + 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(false), ""); +} Index: testsuite/20_util/is_enum/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_enum/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_enum/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_enum; +} Index: testsuite/20_util/is_enum/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_enum/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_enum/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_enum 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; +} Index: testsuite/20_util/is_enum/value.cc =================================================================== --- testsuite/20_util/is_enum/value.cc (revision 0) +++ testsuite/20_util/is_enum/value.cc (working copy) @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_enum; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + + // Negative tests. + 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(false), ""); + + static_assert(test_category(false), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_pointer/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_pointer; +} Index: testsuite/20_util/is_pointer/value.cc =================================================================== --- testsuite/20_util/is_pointer/value.cc (revision 0) +++ testsuite/20_util/is_pointer/value.cc (working copy) @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_pointer; + using namespace __gnu_test; + + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_polymorphic/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_polymorphic/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_polymorphic/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_polymorphic; +} Index: testsuite/20_util/is_polymorphic/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_polymorphic/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_polymorphic/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_polymorphic 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; +} Index: testsuite/20_util/is_polymorphic/value.cc =================================================================== --- testsuite/20_util/is_polymorphic/value.cc (revision 0) +++ testsuite/20_util/is_polymorphic/value.cc (working copy) @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 +#include + +void test01() +{ + using std::is_polymorphic; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + + // Negative tests. + 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), ""); +} Index: testsuite/20_util/is_same/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_same/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_same/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_same; +} Index: testsuite/20_util/is_same/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_same/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_same/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_same 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; +} Index: testsuite/20_util/is_same/value.cc =================================================================== --- testsuite/20_util/is_same/value.cc (revision 0) +++ testsuite/20_util/is_same/value.cc (working copy) @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_same; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + + // Negative tests. + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); +} Index: testsuite/20_util/is_union/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_union/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_union/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_union; +} Index: testsuite/20_util/is_union/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_union/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_union/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_union 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; +} Index: testsuite/20_util/is_union/value.cc =================================================================== --- testsuite/20_util/is_union/value.cc (revision 0) +++ testsuite/20_util/is_union/value.cc (working copy) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_union; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_category(true), ""); + + // Negative tests. + 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(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), ""); +} Index: testsuite/20_util/is_void/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_void/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_void/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_void; +} Index: testsuite/20_util/is_void/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_void/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_void/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_void 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; +} Index: testsuite/20_util/is_void/value.cc =================================================================== --- testsuite/20_util/is_void/value.cc (revision 0) +++ testsuite/20_util/is_void/value.cc (working copy) @@ -0,0 +1,51 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_void; + using namespace __gnu_test; + + static_assert(test_category(true), ""); + + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); +#ifdef _GLIBCXX_USE_WCHAR_T + static_assert(test_category(false), ""); +#endif + 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(false), ""); + + // Sanity check. + static_assert(test_category(false), ""); +} Index: testsuite/20_util/is_volatile/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_volatile/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_volatile/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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_volatile; +} Index: testsuite/20_util/is_volatile/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_volatile/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_volatile/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::is_volatile 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; +} Index: testsuite/20_util/is_volatile/value.cc =================================================================== --- testsuite/20_util/is_volatile/value.cc (revision 0) +++ testsuite/20_util/is_volatile/value.cc (working copy) @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::is_volatile; + using namespace __gnu_test; + + // Positive tests. + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + + // Negative tests. + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); +} Index: testsuite/20_util/rank/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/rank/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/rank/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 rank; +} Index: testsuite/20_util/rank/requirements/typedefs.cc =================================================================== --- testsuite/20_util/rank/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/rank/requirements/typedefs.cc (working copy) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + // Check for required typedefs + typedef std::rank 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; +} Index: testsuite/20_util/rank/value.cc =================================================================== --- testsuite/20_util/rank/value.cc (revision 0) +++ testsuite/20_util/rank/value.cc (working copy) @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::rank; + using namespace __gnu_test; + + static_assert(test_property(0), ""); + static_assert(test_property(1), ""); + static_assert(test_property(2), ""); + static_assert(test_property(6), ""); + static_assert(test_property(0), ""); + static_assert(test_property(1), ""); + static_assert(test_property(2), ""); + static_assert(test_property(6), ""); +} Index: testsuite/20_util/remove_all_extents/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_all_extents/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_all_extents/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_all_extents; +} Index: testsuite/20_util/remove_all_extents/value.cc =================================================================== --- testsuite/20_util/remove_all_extents/value.cc (revision 0) +++ testsuite/20_util/remove_all_extents/value.cc (working copy) @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_all_extents; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + const ClassType>::value, ""); +} Index: testsuite/20_util/remove_const/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_const/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_const/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_const; +} Index: testsuite/20_util/remove_const/value.cc =================================================================== --- testsuite/20_util/remove_const/value.cc (revision 0) +++ testsuite/20_util/remove_const/value.cc (working copy) @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_const; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, + volatile int>::value, ""); + static_assert(is_same::type, const int*>::value, ""); + static_assert(is_same::type, + volatile ClassType>::value, ""); + static_assert(is_same::type, + const ClassType*>::value, ""); +} Index: testsuite/20_util/remove_cv/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_cv/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_cv/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_cv; +} Index: testsuite/20_util/remove_cv/value.cc =================================================================== --- testsuite/20_util/remove_cv/value.cc (revision 0) +++ testsuite/20_util/remove_cv/value.cc (working copy) @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_cv; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, + const volatile int*>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + const volatile ClassType*>::value, ""); +} Index: testsuite/20_util/remove_extent/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_extent/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_extent/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_extent; +} Index: testsuite/20_util/remove_extent/value.cc =================================================================== --- testsuite/20_util/remove_extent/value.cc (revision 0) +++ testsuite/20_util/remove_extent/value.cc (working copy) @@ -0,0 +1,45 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_extent; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int[3]>::value, ""); + static_assert(is_same::type, int[3]>::value, ""); + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType[3]>::value, ""); + static_assert(is_same::type, + ClassType[3]>::value, ""); + static_assert(is_same::type, + const ClassType>::value, ""); +} Index: testsuite/20_util/remove_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_pointer/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_pointer; +} Index: testsuite/20_util/remove_pointer/value.cc =================================================================== --- testsuite/20_util/remove_pointer/value.cc (revision 0) +++ testsuite/20_util/remove_pointer/value.cc (working copy) @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_pointer; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, int*>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, ClassType>::value, ""); +} Index: testsuite/20_util/remove_volatile/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/remove_volatile/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/remove_volatile/requirements/explicit_instantiation.cc (working copy) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 remove_volatile; +} Index: testsuite/20_util/remove_volatile/value.cc =================================================================== --- testsuite/20_util/remove_volatile/value.cc (revision 0) +++ testsuite/20_util/remove_volatile/value.cc (working copy) @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 + +void test01() +{ + using std::remove_volatile; + using std::is_same; + using namespace __gnu_test; + + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, + volatile int*>::value, ""); + static_assert(is_same::type, + const ClassType>::value, ""); + static_assert(is_same::type, + volatile ClassType*>::value, ""); +}