OSDN Git Service

[libc++] Implement missing feature-test macro __cpp_lib_shared_ptr_arrays
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 8 Dec 2020 20:45:57 +0000 (15:45 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 8 Dec 2020 20:46:45 +0000 (15:46 -0500)
This was forgotten when we implemented support for arrays in std::shared_ptr
in https://reviews.llvm.org/D62259.

libcxx/docs/FeatureTestMacroTable.rst
libcxx/include/version
libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
libcxx/utils/generate_feature_test_macro_components.py

index aa60a03..091d4b7 100644 (file)
@@ -146,7 +146,7 @@ Status
     ------------------------------------------------- -----------------
     ``__cpp_lib_shared_mutex``                        ``201505L``
     ------------------------------------------------- -----------------
-    ``__cpp_lib_shared_ptr_arrays``                   *unimplemented*
+    ``__cpp_lib_shared_ptr_arrays``                   ``201611L``
     ------------------------------------------------- -----------------
     ``__cpp_lib_shared_ptr_weak_type``                ``201606L``
     ------------------------------------------------- -----------------
index 2f1fd92..e32f47a 100644 (file)
@@ -210,7 +210,7 @@ __cpp_lib_void_t                                        201411L <type_traits>
 # if !defined(_LIBCPP_HAS_NO_THREADS)
 #   define __cpp_lib_shared_mutex                       201505L
 # endif
-// # define __cpp_lib_shared_ptr_arrays                    201611L
+# define __cpp_lib_shared_ptr_arrays                    201611L
 # define __cpp_lib_shared_ptr_weak_type                 201606L
 # define __cpp_lib_string_view                          201606L
 // # define __cpp_lib_to_chars                             201611L
index 511c688..4a2b778 100644 (file)
 #   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_ptr_arrays != 201611L
-#     error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_shared_ptr_arrays
+#   error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201611L
+#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
 # endif
 
 # ifndef __cpp_lib_shared_ptr_weak_type
 #   error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++2a"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should be defined in c++2a"
-#   endif
-#   if __cpp_lib_shared_ptr_arrays != 201611L
-#     error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++2a"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_shared_ptr_arrays
+#   error "__cpp_lib_shared_ptr_arrays should be defined in c++2a"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201611L
+#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++2a"
 # endif
 
 # ifndef __cpp_lib_shared_ptr_weak_type
index 0aaef3c..783c544 100644 (file)
 #   endif
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
-#   endif
-#   if __cpp_lib_shared_ptr_arrays != 201611L
-#     error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_shared_ptr_arrays
+#   error "__cpp_lib_shared_ptr_arrays should be defined in c++17"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201611L
+#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17"
 # endif
 
 # ifndef __cpp_lib_shared_ptr_weak_type
 #   endif
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should be defined in c++2a"
-#   endif
-#   if __cpp_lib_shared_ptr_arrays != 201611L
-#     error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++2a"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_shared_ptr_arrays
-#     error "__cpp_lib_shared_ptr_arrays should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_shared_ptr_arrays
+#   error "__cpp_lib_shared_ptr_arrays should be defined in c++2a"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201611L
+#   error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++2a"
 # endif
 
 # ifndef __cpp_lib_shared_ptr_weak_type
index c3b28c5..2364fac 100755 (executable)
@@ -200,9 +200,8 @@ feature_test_macros = sorted([ add_version_header(x) for x in [
     "headers": ["memory"],
   }, {
     "name": "__cpp_lib_shared_ptr_arrays",
-    "values": { "c++17": int(201611) },
+    "values": { "c++17": int(201611) }, # "c++20": int(201707) # Enable this when we support arrays in std::make_shared
     "headers": ["memory"],
-    "unimplemented": True,
   }, {
     "name": "__cpp_lib_memory_resource",
     "values": { "c++17": int(201603) },