From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 2C8B6383509E for ; Wed, 16 Dec 2020 13:38:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2C8B6383509E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-EOFdYufgO8a-aSyjbvHCvw-1; Wed, 16 Dec 2020 08:38:24 -0500 X-MC-Unique: EOFdYufgO8a-aSyjbvHCvw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F7401014E63; Wed, 16 Dec 2020 13:38:23 +0000 (UTC) Received: from localhost (unknown [10.33.36.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E7345D9C0; Wed, 16 Dec 2020 13:38:22 +0000 (UTC) Date: Wed, 16 Dec 2020 13:38:22 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix errors from Library Fundamentals TS headers in C++11 [PR 98319] Message-ID: <20201216133822.GA1029081@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 13:38:28 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Currently the , and headers can be included in C++98 and C++11 modes, but gives errors. With this change they can be included, but define nothing. libstdc++-v3/ChangeLog: PR libstdc++/98319 * include/experimental/random: Only define contents for C++14 and later. * include/experimental/source_location: Likewise. * include/experimental/utility: Likewise. * testsuite/experimental/feat-lib-fund.cc: Include all LFTS headers that are present. Allow test to run for all modes. Tested powerpc64le-linux. Committed to trunk. --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit ab9bd93271061f436c10e35e261ecb73e2108ccc Author: Jonathan Wakely Date: Wed Dec 16 13:37:17 2020 libstdc++: Fix errors from Library Fundamentals TS headers in C++11 [PR 98319] Currently the , and headers can be included in C++98 and C++11 modes, but gives errors. With this change they can be included, but define nothing. libstdc++-v3/ChangeLog: PR libstdc++/98319 * include/experimental/random: Only define contents for C++14 and later. * include/experimental/source_location: Likewise. * include/experimental/utility: Likewise. * testsuite/experimental/feat-lib-fund.cc: Include all LFTS headers that are present. Allow test to run for all modes. diff --git a/libstdc++-v3/include/experimental/random b/libstdc++-v3/include/experimental/random index 2ec1a4b7e42..4165a8520c8 100644 --- a/libstdc++-v3/include/experimental/random +++ b/libstdc++-v3/include/experimental/random @@ -30,6 +30,7 @@ #ifndef _GLIBCXX_EXPERIMENTAL_RANDOM #define _GLIBCXX_EXPERIMENTAL_RANDOM 1 +#if __cplusplus >= 201402L #include #include @@ -78,4 +79,5 @@ inline namespace fundamentals_v2 { _GLIBCXX_END_NAMESPACE_VERSION } // namespace std -#endif +#endif // C++14 +#endif // _GLIBCXX_EXPERIMENTAL_RANDOM diff --git a/libstdc++-v3/include/experimental/source_location b/libstdc++-v3/include/experimental/source_location index 9d5b5eae5f3..b4f00f1c039 100644 --- a/libstdc++-v3/include/experimental/source_location +++ b/libstdc++-v3/include/experimental/source_location @@ -30,6 +30,7 @@ #ifndef _GLIBCXX_EXPERIMENTAL_SRCLOC #define _GLIBCXX_EXPERIMENTAL_SRCLOC 1 +#if __cplusplus >= 201402L #include namespace std { @@ -84,4 +85,5 @@ inline namespace fundamentals_v2 { _GLIBCXX_END_NAMESPACE_VERSION } // namespace std -#endif +#endif // C++14 +#endif // _GLIBCXX_EXPERIMENTAL_SRCLOC diff --git a/libstdc++-v3/include/experimental/utility b/libstdc++-v3/include/experimental/utility index f0c3b4fcd90..8abf55c0526 100644 --- a/libstdc++-v3/include/experimental/utility +++ b/libstdc++-v3/include/experimental/utility @@ -30,6 +30,7 @@ #ifndef _GLIBCXX_EXPERIMENTAL_UTILITY #define _GLIBCXX_EXPERIMENTAL_UTILITY 1 +#if __cplusplus >= 201402L #include #include #include @@ -47,4 +48,5 @@ inline namespace fundamentals_v2 { _GLIBCXX_END_NAMESPACE_VERSION } // namespace std -#endif +#endif // C++14 +#endif // _GLIBCXX_EXPERIMENTAL_UTILITY diff --git a/libstdc++-v3/testsuite/experimental/feat-lib-fund.cc b/libstdc++-v3/testsuite/experimental/feat-lib-fund.cc index b0e6e289009..342edc5352d 100644 --- a/libstdc++-v3/testsuite/experimental/feat-lib-fund.cc +++ b/libstdc++-v3/testsuite/experimental/feat-lib-fund.cc @@ -1,57 +1,36 @@ -// { dg-do preprocess { target c++14 } } +// { dg-do preprocess } -#if !__has_include() -# error "" +// Include all the LFTS headers. This should work with any -std flag. + +#include +#include +#include +#include +#include +#include +#include +#if __has_include() // not supported as of GCC 11 +# include #endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -#if !__has_include() -# error "" -#endif - -//#if !__has_include() -//# error "" -//#endif - -//#if !__has_include() -//# error "" -//#endif - -//#if !__has_include() -//# error "" -//#endif - -#if !__has_include() -# error "" -#endif - -//#if !__has_include() -//# error "" -//#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include --vtzGhvizbBRQ85DL--