public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Add tests for std::invoke feature test macro
Date: Wed, 5 May 2021 13:01:08 +0100	[thread overview]
Message-ID: <YJKJBJnsXlIsKFsL@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

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.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1780 bytes --]

commit 29745bf06276b9628d08ef1c9e28890cc56df4aa
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed May 5 12:41:14 2021

    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.

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
 // <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;
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 <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

                 reply	other threads:[~2021-05-05 12:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJKJBJnsXlIsKFsL@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).