]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add feature test macro for <experimental/scope>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 5 Aug 2022 14:17:20 +0000 (15:17 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 5 Aug 2022 14:17:57 +0000 (15:17 +0100)
libstdc++-v3/ChangeLog:

* include/experimental/scope (__cpp_lib_experimental_scope):
Define.
* testsuite/experimental/scopeguard/uniqueres.cc: Check macro.

libstdc++-v3/include/experimental/scope
libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc

index 37a57b38af73f702be2cf9de79257e482541e02e..208fadc513e4e381024ff664e2d0be675071ae08 100644 (file)
@@ -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>;
 
index 7690572ab190f45ecf489c72f74b6a8310712ebd..fe9d6ee7cfc6062e0da03a4971d744a277421ced 100644 (file)
@@ -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