public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-2764] libstdc++: Fix accidental duplicate test [PR91456] Date: Wed, 21 Sep 2022 14:03:02 +0000 (GMT) [thread overview] Message-ID: <20220921140302.52A4A38582B8@sourceware.org> (raw) https://gcc.gnu.org/g:5814816641389dd76153aae63e8ccb67a1a9a321 commit r13-2764-g5814816641389dd76153aae63e8ccb67a1a9a321 Author: Jonathan Wakely <jwakely@redhat.com> 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 <functional> 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 <type_traits> #include <functional> @@ -27,7 +30,6 @@ struct Immovable { Immovable& operator=(const Immovable&) = delete; }; -Immovable get() { return {}; } -const Immovable i = get(); // OK -std::function<const Immovable()> f{&get}; // fails -const Immovable i2 = f(); +static_assert(std::is_invocable_r_v<Immovable, Immovable(*)()>); +static_assert(std::is_invocable_r_v<const Immovable, Immovable(*)()>); +static_assert(std::is_invocable_r_v<Immovable, const Immovable(*)()>);
reply other threads:[~2022-09-21 14:03 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220921140302.52A4A38582B8@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).