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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5A567385803D for ; Wed, 10 Nov 2021 12:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A567385803D 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-50-D13lOL53O12-2gRA8QGr8w-1; Wed, 10 Nov 2021 07:05:22 -0500 X-MC-Unique: D13lOL53O12-2gRA8QGr8w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 461F9802E65; Wed, 10 Nov 2021 12:05:21 +0000 (UTC) Received: from localhost (unknown [10.33.36.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8C5560C05; Wed, 10 Nov 2021 12:05:20 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix test for libstdc++ not including [PR100117] Date: Wed, 10 Nov 2021 12:05:20 +0000 Message-Id: <20211110120520.2844048-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 10 Nov 2021 12:05:34 -0000 Tested powerpc64le-linux, pushed to trunk. The headers for the C library are not under our control, so we can't prevent them from including . Change the PR 49745 test to only include the C++ library headers, not the ones. To ensure isn't included automatically we need to use no_pch to disable PCH. libstdc++-v3/ChangeLog: PR libstdc++/100117 * testsuite/17_intro/headers/c++1998/49745.cc: Explicitly list all C++ headers instead of including --- .../17_intro/headers/c++1998/49745.cc | 113 +++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc index 204975e0316..f98fa3b4fb9 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc @@ -1,4 +1,5 @@ // { dg-do compile { target *-*-linux* *-*-gnu* } } +// { dg-add-options no_pch } // Copyright (C) 2011-2021 Free Software Foundation, Inc. // @@ -18,7 +19,117 @@ // . // libstdc++/49745 -#include +// error: 'int truncate' redeclared as different kind of symbol + +// This tests that no libstdc++ headers include . +// However, as discussed in PR libstdc++/100117 we cannot guarantee that +// no libc headers include it indirectly, so only include the C++ headers. +// That means we can't use because that includes etc. +// so we list the C++ headers explicitly here. This list is unfortunately +// doomed to get out of date as new headers are added to the library. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __cplusplus >= 201103L +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#if __cplusplus >= 201402L +#include +#endif + +#if __cplusplus >= 201703L +#include +#include +// #include +#include +#include +#include +#include +#include +#endif + +#if __cplusplus >= 202002L +#include +#include +#include +#include +#if __cpp_impl_coroutine +# include +#endif +#if __has_include () +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#if __cplusplus > 202002L +#if __has_include() +# include +#endif +#if __has_include() +# include +#endif +#endif + int truncate = 0; // { dg-xfail-if "PR libstdc++/99995" { c++20 } } -- 2.31.1