From patchwork Fri Sep 11 12:25:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 516780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2A551140323 for ; Fri, 11 Sep 2015 22:26:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=kSyFIHuV; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=Z4IoN9s8ttBPyG9avmRptv3TPs6bvEV+0RO5OB5w4Nz1CsJ8j9Q/c JB2GG8CjqP+DC0HLjjws3kcgxb1L4iLHtJU/TFOjmy2oNd5uYoAO7solSALA6wyg WkyDEALqjzCrFg2sL46KWpnFMYJ1/pKdPC17V77DqhkpVCV6wEiUPM= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=nWSsQGfDJ09JJiI4W2zhjQs1SiQ=; b=kSyFIHuVoTL9nszd3qXo ZyTTwJ3ioVrjExrtdTouPILVQJ34MUKXSOz1TWfqR2hUf9euOHJToDe4z+xrsgHl W/QRrcBHWN/qlTEzKwnBtdqq8Iu6Hmwm7drk7K6QHAbPQIGidYCxz3xpnQyRMP3b DhqmNWQncgnUN/U44PxvBK4= Received: (qmail 50067 invoked by alias); 11 Sep 2015 12:25:56 -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 50043 invoked by uid 89); 11 Sep 2015 12:25:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Sep 2015 12:25:45 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8D473550D0; Fri, 11 Sep 2015 12:25:43 +0000 (UTC) Received: from localhost (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8BCPgUb025362; Fri, 11 Sep 2015 08:25:42 -0400 Date: Fri, 11 Sep 2015 13:25:42 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] libstdc++/64857 Rationalise PCH headers and 17_intro/headers tests. Message-ID: <20150911122542.GG2631@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) Ensure that includes everything, and rename the 17_intro/headers/c++200x directory to c++2011. Tested powerpc64le-linux, committed to trunk. commit 3b07b2a428725ba70636e00a1f6ed8a28bb59b44 Author: Jonathan Wakely Date: Thu Jan 29 13:12:22 2015 +0000 Rationalise PCH headers and 17_intro/headers tests. PR libstdc++/64857 * doc/xml/manual/using.xml: Improve aggregate header documentation. * doc/html/manual/*: Regenerate. * include/precompiled/extc++.h: Include for C++11 and later and include more extension headers. * testsuite/17_intro/headers/c++1998/all_attributes.cc: Remove redundant header. * testsuite/17_intro/headers/c++200x/: Rename to c++2011. * testsuite/17_intro/headers/c++2014/all_attributes.cc: Remove redundant headers. * testsuite/17_intro/headers/c++2014/all_no_exceptions.cc: New. * testsuite/17_intro/headers/c++2014/all_no_rtti.cc: New. * testsuite/17_intro/headers/c++2014/all_pedantic_errors.cc: New. * testsuite/17_intro/headers/c++2014/operator_names.cc: New. * testsuite/17_intro/headers/c++2014/stdc++.cc: New. * testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc: New. diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml index bad49f2..2c8d179 100644 --- a/libstdc++-v3/doc/xml/manual/using.xml +++ b/libstdc++-v3/doc/xml/manual/using.xml @@ -16,7 +16,8 @@ The standard library conforms to the dialect of C++ specified by the option passed to the compiler. By default, g++ is equivalent to - g++ -std=gnu++98. + g++ -std=gnu++14 since GCC 6, and + g++ -std=gnu++98 for older releases. @@ -718,7 +719,7 @@ and std::sinl. There are three base header files that are provided. They can be used to precompile the standard headers and extensions into binary -files that may the be used to speed compiles that use these headers. +files that may then be used to speed up compilations that use these headers. @@ -726,7 +727,7 @@ files that may the be used to speed compiles that use these headers. stdc++.h Includes all standard headers. Actual content varies depending on -language dialect. +language dialect. @@ -737,13 +738,14 @@ language dialect. extc++.h -Includes all of <stdtr1c++.h>, and adds all the Extension headers. +Includes all of <stdc++.h>, and adds all the Extension headers +(and in C++98 mode also adds all the TR1 headers by including all of +<stdtr1c++.h>). -How to construct a .gch file from one of these base header files. - -First, find the include directory for the compiler. One way to do +To construct a .gch file from one of these base header files, +first find the include directory for the compiler. One way to do this is: diff --git a/libstdc++-v3/include/precompiled/extc++.h b/libstdc++-v3/include/precompiled/extc++.h index de3775b..8883e47 100644 --- a/libstdc++-v3/include/precompiled/extc++.h +++ b/libstdc++-v3/include/precompiled/extc++.h @@ -28,15 +28,25 @@ #if __cplusplus < 201103L #include +#else +#include #endif #include +#if __cplusplus >= 201103L +# include +#endif +#include #include #include #include #include +#if __cplusplus >= 201103L +# include +#endif #include #include +#include #include #include #include @@ -45,9 +55,13 @@ #include #include #include +#include #include #include #include +#if __cplusplus >= 201103L +# include +#endif #include #include #include diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc index 7bc7ffe..20107d2 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc @@ -35,7 +35,6 @@ #define unused 1 #endif -#include // TODO: this is missing from #include int diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/42319.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/42319.cc deleted file mode 100644 index 65afb57..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/42319.cc +++ /dev/null @@ -1,22 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++11" } - -// Copyright (C) 2009-2015 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 -// . - -// libstdc++/42319 -#include diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc deleted file mode 100644 index 97df10f..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 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 -// . - -// { dg-options "-std=gnu++11 -fsingle-precision-constant" } -// { dg-do compile } - -// libstdc++/67309 -#include // TODO: this is missing from -#include diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc deleted file mode 100644 index ae15f31..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2015 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 -// . - -// { dg-options "-std=gnu++11" } -// { dg-do compile } - -// Ensure the library only uses the __name__ form for attributes. -// Don't test 'const' and 'noreturn' because they are reserved anyway. -#define abi_tag 1 -#define always_inline 1 -#ifndef __APPLE__ -// darwin headers use these, see PR 64883 -# define visibility 1 -# define deprecated 1 -#endif -#define packed 1 -#define pure 1 -// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. -#ifndef __arm__ -#define unused 1 -#endif - -#include // TODO: this is missing from -#include - -int -main() -{ -} diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_exceptions.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_exceptions.cc deleted file mode 100644 index 13158d1..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_exceptions.cc +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++11 -fno-exceptions" } - -// Copyright (C) 2007-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_rtti.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_rtti.cc deleted file mode 100644 index 7bbc25f..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_no_rtti.cc +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++11 -fno-rtti" } - -// Copyright (C) 2010-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_pedantic_errors.cc deleted file mode 100644 index ad5847e..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_pedantic_errors.cc +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++11 -pedantic-errors" } - -// Copyright (C) 2007-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/operator_names.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/operator_names.cc deleted file mode 100644 index 028c2ef..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/operator_names.cc +++ /dev/null @@ -1,30 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++11 -fno-operator-names" } - -// Copyright (C) 2011-2015 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 -// . - -// libstdc++/47662 - -// Avoid using PCH -#include -#include -#include -#include - -int or, xor, and; - diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc deleted file mode 100644 index d1c64b1..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc +++ /dev/null @@ -1,70 +0,0 @@ -// FreeBSD wants warning clean system headers: -// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } -// { dg-options "-std=gnu++11" } -// { dg-do compile } - -// Copyright (C) 2007-2015 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 -// . - -// 17.4.1.2 Headers - -#include - -// "C" compatibility headers -#include -#ifdef _GLIBCXX_HAVE_COMPLEX_H -#include -#endif -#include -#include -#ifdef _GLIBCXX_HAVE_FENV_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_INTTYPES_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef _GLIBCXX_HAVE_STDBOOL_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_STDINT_H -#include -#endif -#include -#include -#include -#ifdef _GLIBCXX_HAVE_TGMATH_H -#include -#endif -#include -#if __has_include() -#include -#endif -#ifdef _GLIBCXX_HAVE_WCHAR_H -#include -#endif -#ifdef _GLIBCXX_HAVE_WCTYPE_H -#include -#endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc deleted file mode 100644 index e51bdee..0000000 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc +++ /dev/null @@ -1,117 +0,0 @@ -// FreeBSD wants warning clean system headers: -// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } -// { dg-options "-std=gnu++11" } -// { dg-do compile } - -// Copyright (C) 2007-2015 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 -// . - -// 17.4.1.2 Headers - -#include - -// "C" compatibility headers -#include -#ifdef _GLIBCXX_HAVE_COMPLEX_H -#include -#endif -#include -#include -#ifdef _GLIBCXX_HAVE_FENV_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_INTTYPES_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef _GLIBCXX_HAVE_STDBOOL_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_STDINT_H -#include -#endif -#include -#include -#include -#ifdef _GLIBCXX_HAVE_TGMATH_H -#include -#endif -#include -#if __has_include() -#include -#endif -#ifdef _GLIBCXX_HAVE_WCHAR_H -#include -#endif -#ifdef _GLIBCXX_HAVE_WCTYPE_H -#include -#endif - -#include - -// "C" compatibility headers -#include -#ifdef _GLIBCXX_HAVE_COMPLEX_H -#include -#endif -#include -#include -#ifdef _GLIBCXX_HAVE_FENV_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_INTTYPES_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef _GLIBCXX_HAVE_STDBOOL_H -#include -#endif -#include -#ifdef _GLIBCXX_HAVE_STDINT_H -#include -#endif -#include -#include -#include -#ifdef _GLIBCXX_HAVE_TGMATH_H -#include -#endif -#include -#if __has_include() -#include -#endif -#ifdef _GLIBCXX_HAVE_WCHAR_H -#include -#endif -#ifdef _GLIBCXX_HAVE_WCTYPE_H -#include -#endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc new file mode 100644 index 0000000..65afb57 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2009-2015 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 +// . + +// libstdc++/42319 +#include diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc new file mode 100644 index 0000000..409b38d --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/67309.cc @@ -0,0 +1,22 @@ +// Copyright (C) 2015 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 +// . + +// { dg-options "-std=gnu++11 -fsingle-precision-constant" } +// { dg-do compile } + +// libstdc++/67309 +#include diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc new file mode 100644 index 0000000..8c3d007 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc @@ -0,0 +1,42 @@ +// Copyright (C) 2015 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 +// . + +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Ensure the library only uses the __name__ form for attributes. +// Don't test 'const' and 'noreturn' because they are reserved anyway. +#define abi_tag 1 +#define always_inline 1 +#ifndef __APPLE__ +// darwin headers use these, see PR 64883 +# define visibility 1 +# define deprecated 1 +#endif +#define packed 1 +#define pure 1 +// glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. +#ifndef __arm__ +#define unused 1 +#endif + +#include + +int +main() +{ +} diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc new file mode 100644 index 0000000..13158d1 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_exceptions.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11 -fno-exceptions" } + +// Copyright (C) 2007-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc new file mode 100644 index 0000000..7bbc25f --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_no_rtti.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11 -fno-rtti" } + +// Copyright (C) 2010-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc new file mode 100644 index 0000000..ad5847e --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_pedantic_errors.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11 -pedantic-errors" } + +// Copyright (C) 2007-2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc new file mode 100644 index 0000000..028c2ef --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/operator_names.cc @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11 -fno-operator-names" } + +// Copyright (C) 2011-2015 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 +// . + +// libstdc++/47662 + +// Avoid using PCH +#include +#include +#include +#include + +int or, xor, and; + diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc new file mode 100644 index 0000000..d1c64b1 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++.cc @@ -0,0 +1,70 @@ +// FreeBSD wants warning clean system headers: +// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2007-2015 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 +// . + +// 17.4.1.2 Headers + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc new file mode 100644 index 0000000..e51bdee --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc @@ -0,0 +1,117 @@ +// FreeBSD wants warning clean system headers: +// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2007-2015 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 +// . + +// 17.4.1.2 Headers + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc index c482fbd..c395e1d 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc @@ -34,8 +34,6 @@ #define unused 1 #endif -#include // TODO: this is missing from -#include // TODO: this is missing from #include int diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_exceptions.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_exceptions.cc new file mode 100644 index 0000000..b5157c8 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_exceptions.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++14 -fno-exceptions" } + +// Copyright (C) 2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_rtti.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_rtti.cc new file mode 100644 index 0000000..8b9fec7 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_no_rtti.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++14 -fno-rtti" } + +// Copyright (C) 2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_pedantic_errors.cc new file mode 100644 index 0000000..742315d --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_pedantic_errors.cc @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "-std=gnu++14 -pedantic-errors" } + +// Copyright (C) 2015 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 diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/operator_names.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/operator_names.cc new file mode 100644 index 0000000..c347368 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/operator_names.cc @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-options "-std=gnu++14 -fno-operator-names" } + +// Copyright (C) 2015 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 +// . + +// libstdc++/47662 + +// Avoid using PCH +#include +#include +#include +#include + +int or, xor, and; + diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc new file mode 100644 index 0000000..0528b33 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++.cc @@ -0,0 +1,70 @@ +// FreeBSD wants warning clean system headers: +// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2015 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 +// . + +// 17.4.1.2 Headers + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc new file mode 100644 index 0000000..67b51ce --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc @@ -0,0 +1,117 @@ +// FreeBSD wants warning clean system headers: +// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2015 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 +// . + +// 17.4.1.2 Headers + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif + +#include + +// "C" compatibility headers +#include +#ifdef _GLIBCXX_HAVE_COMPLEX_H +#include +#endif +#include +#include +#ifdef _GLIBCXX_HAVE_FENV_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_INTTYPES_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifdef _GLIBCXX_HAVE_STDBOOL_H +#include +#endif +#include +#ifdef _GLIBCXX_HAVE_STDINT_H +#include +#endif +#include +#include +#include +#ifdef _GLIBCXX_HAVE_TGMATH_H +#include +#endif +#include +#if __has_include() +#include +#endif +#ifdef _GLIBCXX_HAVE_WCHAR_H +#include +#endif +#ifdef _GLIBCXX_HAVE_WCTYPE_H +#include +#endif