From patchwork Sat Nov 11 00:44:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 164041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1475607vqs; Fri, 10 Nov 2023 16:47:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IETBCkKXE8a1WWVEwMWQqGYYb2d/8xiTn9bXAdDWgqv5lncnq1dYkmz4czLOyyNPV7QNgjw X-Received: by 2002:a05:622a:a:b0:419:5309:20fd with SMTP id x10-20020a05622a000a00b00419530920fdmr914547qtw.25.1699663622373; Fri, 10 Nov 2023 16:47:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699663622; cv=pass; d=google.com; s=arc-20160816; b=MvmX9cLrAiXZ7DtLkKUgY24ufZqEeWGQkNLTQ5GJoJkT2O37sHhbG67kHq1vVw42l3 WN3QEvFfvKY3ISUjNWa+S5h32SJvLAMn7paOjj0xFxPQ6MROJi989zY/VVoX6KFnYOZQ OK6Z7VkUJVvZSWeXNmVIG62Lh/4hyegZGLVG3IT3nBukiBUTIi0xYme2agxf2vnRTKFC L4j3nRiVvhCRi5rk9uqcYjxg5gullSs7JDW0x+nVtNhNbV/Cz0zCtWWuzHmkcylO9eJp mFKiFVn+eyGdpDDaZFOi9m1D6RTVmxU63HuAxYHCKYhdsL1zl5jTD3YH5cXP6HQpcYOg Vx8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=k32ojoWx1jiwBiVrVPmkpV1z26f3tSp5B/v8klSEUSI=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=d1HaU/lE/l4eUXH44X27YHIhOa4I5x6msK0j6wNH0nAO5hq2mHt+lOHeMEKUHhfb1n 7eoR7EAimwUwt7fRYNJn6TadJv7C1Uoq0lhjUSjmyia332GcVPntSITzNKCTg5acWyXl m1GQrSttulBKi3/J6KSnRcOPNOMPf2IuhQg079Iilpg0/ARmGzESiobHqJNGoKGD7FWZ 7FQIEen+MvRsCiFMaVCQYUUWl3r1o551o/0If2OYoQBbzAK3XxmnpSdiSZ3EUkUc62H8 I9tzJ4IroAPY6MT6Lbe2b6okfoCsKj+fLZlnub97OzFq8zGBeEGEhU9yhpzYOngG0HuD EeGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CpCCixLJ; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h8-20020ac87d48000000b0041e58008b80si605432qtb.744.2023.11.10.16.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 16:47:02 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CpCCixLJ; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 778A83959C5C for ; Sat, 11 Nov 2023 00:45:52 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTPS id DDCD7388B69C for ; Sat, 11 Nov 2023 00:45:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DDCD7388B69C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DDCD7388B69C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663504; cv=none; b=bj2XS1XOdwI4O161EdGqBaBQsjNsyi+FVG5K6Bm4jEn/+95DdATAKb5ZnMaUhB8FpAiyx+o1laBtUUXvmGMBvyj0JB5e4TF0jnorPAocBZPWh6tT+m0GtpkfAaEqym9GCHbh4eoiGSXoaKYQSUG5Jqmc2RY6lIwGpQcazQeEXJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699663504; c=relaxed/simple; bh=ikx/ALKYCE1kzIvul5kEOHswXU347MyJ5Z46gKeJsMc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=S116zDga9yDKvkqujMiSLChhWx48UrdIZD8saVILDyMKjMAIayeiOSDEdfN9LEn6Zvi0u01RMCJqQ9iFryhQQxq87r/WSR3swv7o8wAFb+ld35D/RhS/SIJVOUTCrQLIUy7Btz8jXIrcxnJwPZt5sBU+z9piHce9E/BHWel7CXA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699663502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k32ojoWx1jiwBiVrVPmkpV1z26f3tSp5B/v8klSEUSI=; b=CpCCixLJ1Sj8tGUe2sBaO4+Dd9lwgZZqQyAn7yZ0H+TFc6QFjIP6DIqnUeN6bU2717hQ1M sArEu+jdTRuhTrrrbBPiVA6zF6GWFPuihDoHEAQJIpyvYkjmorP1/svyGksi+6VkDHnPQZ dMjA07PIxDbP3zFxITAT5o8eDMgybO4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-401-ok4TC5pIP8-l-yEOoZczgg-1; Fri, 10 Nov 2023 19:44:59 -0500 X-MC-Unique: ok4TC5pIP8-l-yEOoZczgg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D732F3C025C2; Sat, 11 Nov 2023 00:44:58 +0000 (UTC) Received: from localhost (unknown [10.42.28.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A10D07AD9; Sat, 11 Nov 2023 00:44:58 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix test that fails with -ffreestanding Date: Sat, 11 Nov 2023 00:44:54 +0000 Message-ID: <20231111004458.78235-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782226482641380132 X-GMAIL-MSGID: 1782226482641380132 Tested x86_64-linux. Pushed to trunk. -- >8 -- The -ffreestanding option disables Debug Mode, forcibly #undef'ing _GLIBCXX_DEBUG. This means that the dangling checks in std::pair are disabled for -ffreestanding in C++17 and earlier, because they depend on _GLIBCXX_DEBUG. Adjust the target specifiers for the errors currently matching c++17_down so they also require the hosted effective target. libstdc++-v3/ChangeLog: * testsuite/20_util/pair/dangling_ref.cc: Add hosted effective target for specifiers using c++17_down. --- .../testsuite/20_util/pair/dangling_ref.cc | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/pair/dangling_ref.cc b/libstdc++-v3/testsuite/20_util/pair/dangling_ref.cc index 8e0c34816dd..ca238f9cbd1 100644 --- a/libstdc++-v3/testsuite/20_util/pair/dangling_ref.cc +++ b/libstdc++-v3/testsuite/20_util/pair/dangling_ref.cc @@ -22,15 +22,15 @@ void test_binary_ctors() { std::pair p1(1L, 2); - // { dg-error "here" "" { target c++17_down } 24 } + // { dg-error "here" "" { target { c++17_down && hosted } } 24 } // { dg-error "use of deleted function" "" { target c++20 } 24 } std::pair p2(1, 2L); - // { dg-error "here" "" { target c++17_down } 28 } + // { dg-error "here" "" { target { c++17_down && hosted } } 28 } // { dg-error "use of deleted function" "" { target c++20 } 28 } std::pair p3(1L, 2L); - // { dg-error "here" "" { target c++17_down } 32 } + // { dg-error "here" "" { target { c++17_down && hosted } } 32 } // { dg-error "use of deleted function" "" { target c++20 } 32 } } @@ -40,28 +40,28 @@ test_converting_ctors() std::pair p0; std::pair p1(p0); - // { dg-error "here" "" { target c++17_down } 42 } + // { dg-error "here" "" { target { c++17_down && hosted } } 42 } // { dg-error "use of deleted function" "" { target c++20 } 42 } std::pair p2(p0); - // { dg-error "here" "" { target c++17_down } 46 } + // { dg-error "here" "" { target { c++17_down && hosted } } 46 } // { dg-error "use of deleted function" "" { target c++20 } 46 } std::pair p3(p0); - // { dg-error "here" "" { target c++17_down } 50 } + // { dg-error "here" "" { target { c++17_down && hosted } } 50 } // { dg-error "use of deleted function" "" { target c++20 } 50 } std::pair p4(std::move(p0)); - // { dg-error "here" "" { target c++17_down } 54 } + // { dg-error "here" "" { target { c++17_down && hosted } } 54 } // { dg-error "use of deleted function" "" { target c++20 } 54 } std::pair p5(std::move(p0)); - // { dg-error "here" "" { target c++17_down } 58 } + // { dg-error "here" "" { target { c++17_down && hosted } } 58 } // { dg-error "use of deleted function" "" { target c++20 } 58 } std::pair p6(std::move(p0)); - // { dg-error "here" "" { target c++17_down } 62 } + // { dg-error "here" "" { target { c++17_down && hosted } } 62 } // { dg-error "use of deleted function" "" { target c++20 } 62 } } -// { dg-error "static assert.* dangling reference" "" { target { c++17_down } } 0 } +// { dg-error "static assert.* dangling reference" "" { target { c++17_down && hosted } } 0 }