From: Jonathan Wakely Date: Fri, 5 Aug 2022 14:17:20 +0000 (+0100) Subject: libstdc++: Add feature test macro for X-Git-Tag: basepoints/gcc-14~5230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a644cfdee53275e3d07eff0c2126dc88b87aef;p=thirdparty%2Fgcc.git libstdc++: Add feature test macro for libstdc++-v3/ChangeLog: * include/experimental/scope (__cpp_lib_experimental_scope): Define. * testsuite/experimental/scopeguard/uniqueres.cc: Check macro. --- diff --git a/libstdc++-v3/include/experimental/scope b/libstdc++-v3/include/experimental/scope index 37a57b38af73..208fadc513e4 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 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 7690572ab190..fe9d6ee7cfc6 100644 --- a/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc +++ b/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc @@ -4,6 +4,12 @@ #include #include +#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