[libcxx-commits] [libcxx] b7c0a40 - [libc++] Add FTM for constexpr vector

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 9 13:45:25 PST 2022


Author: Nikolas Klauser
Date: 2022-11-09T22:45:20+01:00
New Revision: b7c0a4065e328846d55b13d6e677b679d31cfb57

URL: https://github.com/llvm/llvm-project/commit/b7c0a4065e328846d55b13d6e677b679d31cfb57
DIFF: https://github.com/llvm/llvm-project/commit/b7c0a4065e328846d55b13d6e677b679d31cfb57.diff

LOG: [libc++] Add FTM for constexpr vector

It looks like we forgot to set the FTM when adding constexpr vector support.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D137729

Added: 
    

Modified: 
    libcxx/docs/FeatureTestMacroTable.rst
    libcxx/include/version
    libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
    libcxx/utils/generate_feature_test_macro_components.py

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index e4a180235604b..5ba070e7a1ea8 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -222,7 +222,7 @@ Status
     ------------------------------------------------- -----------------
     ``__cpp_lib_constexpr_utility``                   ``201811L``
     ------------------------------------------------- -----------------
-    ``__cpp_lib_constexpr_vector``                    *unimplemented*
+    ``__cpp_lib_constexpr_vector``                    ``201907L``
     ------------------------------------------------- -----------------
     ``__cpp_lib_coroutine``                           ``201902L``
     ------------------------------------------------- -----------------

diff  --git a/libcxx/include/version b/libcxx/include/version
index 3e1b6344f5f65..5e2b8cd43a998 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -326,7 +326,7 @@ __cpp_lib_void_t                                        201411L <type_traits>
 # define __cpp_lib_constexpr_string_view                201811L
 # define __cpp_lib_constexpr_tuple                      201811L
 # define __cpp_lib_constexpr_utility                    201811L
-// # define __cpp_lib_constexpr_vector                     201907L
+# define __cpp_lib_constexpr_vector                     201907L
 # define __cpp_lib_coroutine                            201902L
 # if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
 #   define __cpp_lib_destroying_delete                  201806L

diff  --git a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
index c762e93b8112e..2d9b6bfe870b9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
@@ -123,17 +123,11 @@
 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should be defined in c++20"
-#   endif
-#   if __cpp_lib_constexpr_vector != 201907L
-#     error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_vector
+#   error "__cpp_lib_constexpr_vector should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
 # endif
 
 # ifndef __cpp_lib_erase_if
@@ -170,17 +164,11 @@
 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2b"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should be defined in c++2b"
-#   endif
-#   if __cpp_lib_constexpr_vector != 201907L
-#     error "__cpp_lib_constexpr_vector should have the value 201907L in c++2b"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_vector
+#   error "__cpp_lib_constexpr_vector should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++2b"
 # endif
 
 # ifndef __cpp_lib_erase_if

diff  --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 464ec2e2047af..971bb22523ab1 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -2772,17 +2772,11 @@
 #   error "__cpp_lib_constexpr_utility should have the value 201811L in c++20"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should be defined in c++20"
-#   endif
-#   if __cpp_lib_constexpr_vector != 201907L
-#     error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_vector
+#   error "__cpp_lib_constexpr_vector should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++20"
 # endif
 
 # ifndef __cpp_lib_coroutine
@@ -4015,17 +4009,11 @@
 #   error "__cpp_lib_constexpr_utility should have the value 201811L in c++2b"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should be defined in c++2b"
-#   endif
-#   if __cpp_lib_constexpr_vector != 201907L
-#     error "__cpp_lib_constexpr_vector should have the value 201907L in c++2b"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_vector
-#     error "__cpp_lib_constexpr_vector should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_vector
+#   error "__cpp_lib_constexpr_vector should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+#   error "__cpp_lib_constexpr_vector should have the value 201907L in c++2b"
 # endif
 
 # ifndef __cpp_lib_coroutine

diff  --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index e4324fccc9ab2..85629e11755e4 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -277,7 +277,6 @@ def add_version_header(tc):
     "name": "__cpp_lib_constexpr_vector",
     "values": { "c++20": 201907 },
     "headers": ["vector"],
-    "unimplemented": True,
   }, {
     "name": "__cpp_lib_coroutine",
     "values": { "c++20": 201902 },


        


More information about the libcxx-commits mailing list