From patchwork Wed Nov 10 12:05:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 47395 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8EBCC3857C65 for ; Wed, 10 Nov 2021 12:08:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EBCC3857C65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636546139; bh=Xbgf0JHMhJWODHCH5KdRLzCZ1HPbb37YpksuorUdKQg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dldfm4x4C8Gy+vf2VjIsOAI++LDgY2VA6GKfmpKobnI9l4fsJDCPRpaeXFwGItn5h VBVlANNbbl4dAQx8cbwaXz2awuZizkSBU+KU6TrMEVTFXZQmaFlsCff7e/PdXL8ovv iipekeAvHL/IUHTrDeCbtnUyKjdrZsR77H7qrfaU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 9083E3858404 for ; Wed, 10 Nov 2021 12:05:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9083E3858404 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) 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 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=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 } }