Skip to content
Snippets Groups Projects
Commit 58148166 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

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.
parent 16fe325a
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
// { dg-do compile { target c++17 } } // { dg-do compile { target c++17 } }
// PR 91456
// std::function and std::is_invocable_r do not understand guaranteed elision
#include <functional> #include <functional>
struct Immovable { struct Immovable {
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
// { dg-do compile { target c++17 } } // { dg-do compile { target c++17 } }
// PR 91456
// std::function and std::is_invocable_r do not understand guaranteed elision
#include <type_traits> #include <type_traits>
#include <functional> #include <functional>
...@@ -27,7 +30,6 @@ struct Immovable { ...@@ -27,7 +30,6 @@ struct Immovable {
Immovable& operator=(const Immovable&) = delete; Immovable& operator=(const Immovable&) = delete;
}; };
Immovable get() { return {}; } static_assert(std::is_invocable_r_v<Immovable, Immovable(*)()>);
const Immovable i = get(); // OK static_assert(std::is_invocable_r_v<const Immovable, Immovable(*)()>);
std::function<const Immovable()> f{&get}; // fails static_assert(std::is_invocable_r_v<Immovable, const Immovable(*)()>);
const Immovable i2 = f();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment