public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix accidental duplicate test [PR91456]
@ 2022-09-21 14:03 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-09-21 14:03 UTC (permalink / raw)
  To: libstdc++, 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 <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(*)()>);
-- 
2.37.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-21 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 14:03 [committed] libstdc++: Fix accidental duplicate test [PR91456] Jonathan Wakely

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).