From: Louis Dionne Date: Tue, 8 Dec 2020 20:45:57 +0000 (-0500) Subject: [libc++] Implement missing feature-test macro __cpp_lib_shared_ptr_arrays X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a65dc08d105e147c98ef17a47b9504210f6058c5;p=android-x86%2Fexternal-llvm-project.git [libc++] Implement missing feature-test macro __cpp_lib_shared_ptr_arrays This was forgotten when we implemented support for arrays in std::shared_ptr in https://reviews.llvm.org/D62259. --- diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index aa60a033edc..091d4b79523 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -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`` ------------------------------------------------- ----------------- diff --git a/libcxx/include/version b/libcxx/include/version index 2f1fd92db40..e32f47ae837 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -210,7 +210,7 @@ __cpp_lib_void_t 201411L # 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 diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp index 511c688099f..4a2b778a32b 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp @@ -171,17 +171,11 @@ # 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 @@ -267,17 +261,11 @@ # 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 diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp index 0aaef3c5112..783c5449038 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp @@ -1507,17 +1507,11 @@ # 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 @@ -2365,17 +2359,11 @@ # 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 diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index c3b28c55581..2364fac9f96 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -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) },