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: 1343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1952428wrt; Wed, 21 Sep 2022 07:06:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5i+L3pU8X2xeJSRgPe7afYQGeFP/NbzBCM07ZjeI2X118qSG1TSkrM2rzEIBmmYEOTbRHQ X-Received: by 2002:a17:907:a48:b0:77c:51b0:5aeb with SMTP id be8-20020a1709070a4800b0077c51b05aebmr21714883ejc.61.1663769209051; Wed, 21 Sep 2022 07:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663769209; cv=none; d=google.com; s=arc-20160816; b=S3BGjJfTpIuAjuw3NIYXsYGC/Fgj7FKbTxJtW8QZND2KSWmbxuviMdBKM+4YYrGdvc pabqn3BKRdMZf+obdfs3UvKmwmsY6bE3idgJqZ95Jgx4QdqINQfsmKO9eoIal6ZbhE8z cjZpAPJwFO9Bh5uW3NfAtT89Ck5pWvz+KYo3SMGdWPy7qJw/+VsBmHBdBSMwyLNDtj7a HVuQPAEwWFqC9Vh3YZcriR+fJkSrucI1KLkNbTqF49LYuOsbXSbZPQe3rKLQgmXsseie JRN4m6xPCA08yFkISQXZEkgA+QT9ToQO0owg8XxzGc+TD3tKxTobw4nlH1KdjWdWM+70 i8pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=+Z0/DBqAxSN+/sCepq3DzmSsMRDhaubINFguohQpxX4=; b=vi1oYAxbFzjIIMbbbFObAmrb/bHcwNl9jTWjn7bY13XiWCQkgp+FIEmd/MM+ULAfF4 3gb9ns+XioAOlUdUntsxaQlL2laoMp/bIYMEsdePDmQevdJzS1o+uSmduP+eWgiZ1f09 ujnVmVOb+KlghimXP46ZoGcz4qWnrxKKE0184oXsJs/M0KN0Of78c/1xLPHB1hHoHhhK AYKlVSXwTDSTKBDNDb6paC6SePZtp9fkSfUk7F2wNz+XwO4EBpgEreCYCI2Hisk8QW+m vaJm49y9jao5N4i2iqGKIjE/X6KrRjHacwp0yMAAQ1wHMfk65SgxqSUfG95GmBq6FppB JAHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qA2SBIUs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e13-20020a1709062c0d00b00780dd2b1fb3si2138381ejh.867.2022.09.21.07.06.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 07:06:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qA2SBIUs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 580BA385803D for ; Wed, 21 Sep 2022 14:05:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 580BA385803D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663769110; 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=qA2SBIUsuZEVSk9iUZ8zghvbYRQr8vKQWBNX8Rf7sFa7+cnIkOv9Mq+cU1Nj57l/4 fGN4I3E2Y2tPOgXhcElS/V8FbzkLo0pPh22Fco0Tae8z0tFJl7tegf0+80+RziSMAF l34QednRwtqeCTX2vu8a4OQiw9wwU0o+zqmeQ2h8= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1744588462093417480?= X-GMAIL-MSGID: =?utf-8?q?1744588462093417480?= 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);