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 8CF7338582A7 for ; Wed, 21 Sep 2022 14:03:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8CF7338582A7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663769017; 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=+Z0/DBqAxSN+/sCepq3DzmSsMRDhaubINFguohQpxX4=; b=KPsmF+8krfZvY9prXd9z1leJUa9+iHWVfAgGVw5JL7tEXjGrghK7MW+fWanekS+buyl3FK NwlHLoQW04p/WrHEhw99X8Nz6idGweJtWt5mQKCIKQL53H6I4ZMGNAF1DGjv/IKCWkknGG tgfPNirudbmojUxtn65NXhDxgr8bL/c= 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) From: Jonathan Wakely 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit 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 List-Id: 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); -- 2.37.3