From patchwork Wed Sep 21 14:03:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 57854 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 00166385382D for ; Wed, 21 Sep 2022 14:04:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00166385382D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663769096; bh=+Z0/DBqAxSN+/sCepq3DzmSsMRDhaubINFguohQpxX4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=o0+4cT87xahlXbuUUlI3ZHC8JZ4JQCIh8/p36Dm8bKVJCm3n5Yz6axy0dDSmrTj2r dju/UZVaOzGKlIUEgXTdf3VOBKIAzP0UTpVKUXF40/juyuPnPKrSGQCIjXnYzKN1zf RSeF9cJcDjPb/YiPJYNZbJJhFyPW6ofB39VZ4aCI= 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 8CF7338582A7 for ; Wed, 21 Sep 2022 14:03:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8CF7338582A7 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-dgdT8GQ-MiK_erErWlpE6A-1; Wed, 21 Sep 2022 10:03:34 -0400 X-MC-Unique: dgdT8GQ-MiK_erErWlpE6A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8FC9C1C20AF9; Wed, 21 Sep 2022 14:03:33 +0000 (UTC) Received: from localhost (unknown [10.33.36.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57537C15BA4; Wed, 21 Sep 2022 14:03:33 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix accidental duplicate test [PR91456] Date: Wed, 21 Sep 2022 15:03:32 +0100 Message-Id: <20220921140332.922810-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP 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.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 x86_64-linux, pushed to trunk. -- >8 -- It looks like I committed the testcase for std::function twice, instead of one for std::function and one for std::is_invocable_r. This replaces the is_invocable_r one with the example from the PR. libstdc++-v3/ChangeLog: PR libstdc++/91456 * testsuite/20_util/function/91456.cc: Add comment with PR number. * testsuite/20_util/is_invocable/91456.cc: Likewise. Replace std::function checks with std::is_invocable_r checks. --- libstdc++-v3/testsuite/20_util/function/91456.cc | 3 +++ libstdc++-v3/testsuite/20_util/is_invocable/91456.cc | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/function/91456.cc b/libstdc++-v3/testsuite/20_util/function/91456.cc index 6b6631c452d..081bf20e2cf 100644 --- a/libstdc++-v3/testsuite/20_util/function/91456.cc +++ b/libstdc++-v3/testsuite/20_util/function/91456.cc @@ -17,6 +17,9 @@ // { dg-do compile { target c++17 } } +// PR 91456 +// std::function and std::is_invocable_r do not understand guaranteed elision + #include struct Immovable { diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/91456.cc b/libstdc++-v3/testsuite/20_util/is_invocable/91456.cc index a946db15c55..976d257ce85 100644 --- a/libstdc++-v3/testsuite/20_util/is_invocable/91456.cc +++ b/libstdc++-v3/testsuite/20_util/is_invocable/91456.cc @@ -17,6 +17,9 @@ // { dg-do compile { target c++17 } } +// PR 91456 +// std::function and std::is_invocable_r do not understand guaranteed elision + #include #include @@ -27,7 +30,6 @@ struct Immovable { Immovable& operator=(const Immovable&) = delete; }; -Immovable get() { return {}; } -const Immovable i = get(); // OK -std::function f{&get}; // fails -const Immovable i2 = f(); +static_assert(std::is_invocable_r_v); +static_assert(std::is_invocable_r_v); +static_assert(std::is_invocable_r_v);