public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1977] libstdc++: Add feature test macro for <experimental/scope>
@ 2022-08-05 14:18 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-08-05 14:18 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:58a644cfdee53275e3d07eff0c2126dc88b87aef

commit r13-1977-g58a644cfdee53275e3d07eff0c2126dc88b87aef
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Aug 5 15:17:20 2022 +0100

    libstdc++: Add feature test macro for <experimental/scope>
    
    libstdc++-v3/ChangeLog:
    
            * include/experimental/scope (__cpp_lib_experimental_scope):
            Define.
            * testsuite/experimental/scopeguard/uniqueres.cc: Check macro.

Diff:
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-05 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 14:18 [gcc r13-1977] libstdc++: Add feature test macro for <experimental/scope> Jonathan Wakely

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).