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 feature test macro for <experimental/scope>
Date: Fri,  5 Aug 2022 15:20:11 +0100	[thread overview]
Message-ID: <20220805142011.853770-1-jwakely@redhat.com> (raw)
In-Reply-To: <20220805135926.851044-1-jwakely@redhat.com>

I forgot to add this macro to the new header.

Tested x86_64-linux, pushed to trunk.

-- >8 --

libstdc++-v3/ChangeLog:

	* include/experimental/scope (__cpp_lib_experimental_scope):
	Define.
	* testsuite/experimental/scopeguard/uniqueres.cc: Check macro.
---
 libstdc++-v3/include/experimental/scope                     | 2 ++
 libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/libstdc++-v3/include/experimental/scope b/libstdc++-v3/include/experimental/scope
index 37a57b38af7..208fadc513e 100644
--- a/libstdc++-v3/include/experimental/scope
+++ b/libstdc++-v3/include/experimental/scope
@@ -43,6 +43,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 namespace experimental::inline fundamentals_v3
 {
+#define __cpp_lib_experimental_scope 201902
+
   template<typename _Tp, typename _Up>
     concept __not_same_as = !same_as<_Tp, _Up>;
 
diff --git a/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc b/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc
index 7690572ab19..fe9d6ee7cfc 100644
--- a/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc
+++ b/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc
@@ -4,6 +4,12 @@
 #include <experimental/scope>
 #include <testsuite_hooks.h>
 
+#ifndef __cpp_lib_experimental_scope
+# error Feature-test macro is not defined.
+#elif __cpp_lib_experimental_scope < 201902
+# error Feature-test macro has bad value.
+#endif
+
 using std::experimental::unique_resource;
 
 void
-- 
2.37.1


      reply	other threads:[~2022-08-05 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 13:59 [committed] libstdc++: Implement <experimental/scope> from LFTSv3 Jonathan Wakely
2022-08-05 14:20 ` Jonathan Wakely [this message]

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=20220805142011.853770-1-jwakely@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).