From: Jonathan Wakely Date: Wed, 5 May 2021 11:41:14 +0000 (+0100) Subject: libstdc++: Add tests for std::invoke feature test macro X-Git-Tag: releases/gcc-11.2.0~434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f354e7447c27f2a9dfa7fee392355a1c9ef046c;p=thirdparty%2Fgcc.git 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. (cherry picked from commit 29745bf06276b9628d08ef1c9e28890cc56df4aa) --- diff --git a/libstdc++-v3/testsuite/20_util/function_objects/invoke/3.cc b/libstdc++-v3/testsuite/20_util/function_objects/invoke/3.cc index 5ffc5dedbab2..40e068e86fd3 100644 --- a/libstdc++-v3/testsuite/20_util/function_objects/invoke/3.cc +++ b/libstdc++-v3/testsuite/20_util/function_objects/invoke/3.cc @@ -15,11 +15,16 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++17" } // { dg-do compile { target c++17 } } #include +#ifndef __cpp_lib_invoke +# error Feature-test macro for invoke is missing in +#elif __cpp_lib_invoke < 201411L +# error Feature-test macro for invoke has the wrong value in +#endif + struct abstract { virtual ~abstract() = 0; void operator()() noexcept; diff --git a/libstdc++-v3/testsuite/20_util/function_objects/invoke/version.cc b/libstdc++-v3/testsuite/20_util/function_objects/invoke/version.cc new file mode 100644 index 000000000000..cf1a46a1ada9 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/function_objects/invoke/version.cc @@ -0,0 +1,9 @@ +// { dg-do compile { target c++17 } } + +#include + +#ifndef __cpp_lib_invoke +# error Feature-test macro for invoke is missing in +#elif __cpp_lib_invoke < 201411L +# error Feature-test macro for invoke has the wrong value in +#endif