[libcxx-commits] [libcxx] ca1694b - Re-enable __cpp_lib_constexpr_functional.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 8 14:31:24 PST 2021


Author: Arthur O'Dwyer
Date: 2021-01-08T17:30:04-05:00
New Revision: ca1694b9d07cf14dd15d804b37fa151f4e082c2f

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

LOG: Re-enable __cpp_lib_constexpr_functional.

I accidentally disabled this feature-test macro in my D93830,
due to a rebasing conflict. It had been enabled by my D93815,
and should have remained enabled.

Added: 
    

Modified: 
    libcxx/docs/FeatureTestMacroTable.rst
    libcxx/include/version
    libcxx/test/std/language.support/support.limits/support.limits.general/functional.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

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 97edbb0a2e1f..99fb4e790c7d 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -206,7 +206,7 @@ Status
     ------------------------------------------------- -----------------
     ``__cpp_lib_constexpr_dynamic_alloc``             ``201907L``
     ------------------------------------------------- -----------------
-    ``__cpp_lib_constexpr_functional``                *unimplemented*
+    ``__cpp_lib_constexpr_functional``                ``201907L``
     ------------------------------------------------- -----------------
     ``__cpp_lib_constexpr_iterator``                  *unimplemented*
     ------------------------------------------------- -----------------

diff  --git a/libcxx/include/version b/libcxx/include/version
index 9ef782a834de..3920b69a601c 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -296,7 +296,7 @@ __cpp_lib_void_t                                        201411L <type_traits>
 // # define __cpp_lib_constexpr_algorithms                 201806L
 // # define __cpp_lib_constexpr_complex                    201711L
 # define __cpp_lib_constexpr_dynamic_alloc              201907L
-// # define __cpp_lib_constexpr_functional                 201907L
+# define __cpp_lib_constexpr_functional                 201907L
 // # define __cpp_lib_constexpr_iterator                   201811L
 // # define __cpp_lib_constexpr_memory                     201811L
 # define __cpp_lib_constexpr_numeric                    201911L

diff  --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp
index db736a785af2..6fa1ac6ada5b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp
@@ -198,17 +198,11 @@
 #   endif
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should be defined in c++20"
-#   endif
-#   if __cpp_lib_constexpr_functional != 201907L
-#     error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_functional
+#   error "__cpp_lib_constexpr_functional should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
 # endif
 
 # ifndef __cpp_lib_invoke
@@ -287,17 +281,11 @@
 #   endif
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should be defined in c++2b"
-#   endif
-#   if __cpp_lib_constexpr_functional != 201907L
-#     error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_functional
+#   error "__cpp_lib_constexpr_functional should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b"
 # endif
 
 # ifndef __cpp_lib_invoke

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 18b367e868dd..a75d6db28b22 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
@@ -2407,17 +2407,11 @@
 #   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should be defined in c++20"
-#   endif
-#   if __cpp_lib_constexpr_functional != 201907L
-#     error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_functional
+#   error "__cpp_lib_constexpr_functional should be defined in c++20"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++20"
 # endif
 
 # if !defined(_LIBCPP_VERSION)
@@ -3625,17 +3619,11 @@
 #   error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++2b"
 # endif
 
-# if !defined(_LIBCPP_VERSION)
-#   ifndef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should be defined in c++2b"
-#   endif
-#   if __cpp_lib_constexpr_functional != 201907L
-#     error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b"
-#   endif
-# else // _LIBCPP_VERSION
-#   ifdef __cpp_lib_constexpr_functional
-#     error "__cpp_lib_constexpr_functional should not be defined because it is unimplemented in libc++!"
-#   endif
+# ifndef __cpp_lib_constexpr_functional
+#   error "__cpp_lib_constexpr_functional should be defined in c++2b"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+#   error "__cpp_lib_constexpr_functional should have the value 201907L in c++2b"
 # endif
 
 # if !defined(_LIBCPP_VERSION)

diff  --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 922a132511d2..a58c41663066 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -196,7 +196,6 @@ def add_version_header(tc):
     "name": "__cpp_lib_constexpr_functional",
     "values": { "c++20": 201907 },
     "headers": ["functional"],
-    "unimplemented": True,
   }, {
     "name": "__cpp_lib_constexpr_iterator",
     "values": { "c++20": 201811 },


        


More information about the libcxx-commits mailing list