From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 52A4A38582B8; Wed, 21 Sep 2022 14:03:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52A4A38582B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663768982; bh=A9pw3qQP5GDuk5MGGHgdj1sK/3vXYbFN3U6om4Bx6eo=; h=From:To:Subject:Date:From; b=QLQHcxmJ37p1QdLzqoeYUMuHinIaQ99LRJByWJCSaW5rPfk0RciFuu7LPcuO1lzcX HBpqous0sfJkrDO+/BiZAKb09v1CuAiFsEvT+Z0Ep2/LoNxyc3fESb3uqEyyQeB3uR W3LY+FIUIb6CjApBPR1cbiVrmAhB7FAB2A9n24o8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-2764] libstdc++: Fix accidental duplicate test [PR91456] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 16fe325a43274cbab2332ef1c60b9c1ff85db6ef X-Git-Newrev: 5814816641389dd76153aae63e8ccb67a1a9a321 Message-Id: <20220921140302.52A4A38582B8@sourceware.org> Date: Wed, 21 Sep 2022 14:03:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5814816641389dd76153aae63e8ccb67a1a9a321 commit r13-2764-g5814816641389dd76153aae63e8ccb67a1a9a321 Author: Jonathan Wakely Date: Wed Sep 21 14:59:18 2022 +0100 libstdc++: Fix accidental duplicate test [PR91456] 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. Diff: --- 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);