libstdc++: Add tests for std::invoke feature test macro

libstdc++-v3/ChangeLog:

	* testsuite/20_util/function_objects/invoke/3.cc: Check feature
	test macro.
	* testsuite/20_util/function_objects/invoke/version.cc: New test.
This commit is contained in:
Jonathan Wakely 2021-05-05 12:41:14 +01:00
parent d0d6ca0197
commit 29745bf062
2 changed files with 15 additions and 1 deletions

View File

@ -15,11 +15,16 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" }
// { dg-do compile { target c++17 } }
#include <functional>
#ifndef __cpp_lib_invoke
# error Feature-test macro for invoke is missing in <functional>
#elif __cpp_lib_invoke < 201411L
# error Feature-test macro for invoke has the wrong value in <functional>
#endif
struct abstract {
virtual ~abstract() = 0;
void operator()() noexcept;

View File

@ -0,0 +1,9 @@
// { dg-do compile { target c++17 } }
#include <version>
#ifndef __cpp_lib_invoke
# error Feature-test macro for invoke is missing in <version>
#elif __cpp_lib_invoke < 201411L
# error Feature-test macro for invoke has the wrong value in <version>
#endif