From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 10E603AAA05D; Thu, 6 May 2021 13:06:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10E603AAA05D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8368] libstdc++: Add tests for std::invoke feature test macro X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 9ff7e01b7f772cbdf52deed61897c4a2533f7db6 X-Git-Newrev: 4f354e7447c27f2a9dfa7fee392355a1c9ef046c Message-Id: <20210506130636.10E603AAA05D@sourceware.org> Date: Thu, 6 May 2021 13:06:36 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 13:06:36 -0000 https://gcc.gnu.org/g:4f354e7447c27f2a9dfa7fee392355a1c9ef046c commit r11-8368-g4f354e7447c27f2a9dfa7fee392355a1c9ef046c Author: Jonathan Wakely Date: Wed May 5 12:41:14 2021 +0100 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: --- libstdc++-v3/testsuite/20_util/function_objects/invoke/3.cc | 7 ++++++- .../testsuite/20_util/function_objects/invoke/version.cc | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 5ffc5dedbab..40e068e86fd 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 00000000000..cf1a46a1ada --- /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