]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove garbage collection support for C++23 [P2186R2]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 2 Jun 2021 15:41:26 +0000 (16:41 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 22 Jun 2021 19:58:43 +0000 (20:58 +0100)
This removes the non-functional garbage colection support from <memory>,
as proposed for C++23 by P2186R2.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/std/memory (declare_reachable, undeclare_reachable)
(declare_no_pointers, undeclare_no_pointers, get_pointer_safety)
(pointer_safety): Only define for C++11 to C++20 inclusive.
* testsuite/20_util/pointer_safety/1.cc: Do not run for C++23.

libstdc++-v3/include/std/memory
libstdc++-v3/testsuite/20_util/pointer_safety/1.cc

index f19de275b2bc148e83961050bb7803ecabe3c63c..da64be2471a1ec148b09856aef177b9c7481f501 100644 (file)
@@ -87,7 +87,7 @@
 #  include <bits/uses_allocator_args.h>
 #endif
 
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L && __cplusplus <= 202002L
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -132,7 +132,7 @@ get_pointer_safety() noexcept { return pointer_safety::relaxed; }
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
-#endif // C++11
+#endif // C++11 to C++20
 
 #if __cplusplus >= 201703L
 // Parallel STL algorithms
index 7d9a425e3e77c61e2c98ede77cde04467fa2d8c2..bfacbce27d228671bab4e3046ce0559e2c9b739a 100644 (file)
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do run { target c++11 } }
+// { dg-do run { target { c++11 && { ! c++23 } } } }
 
 #include <memory>
 #include <testsuite_hooks.h>