[libcxx-commits] [libcxx] [libc++][NFC] Refactor _LIBCPP_AVAILABILITY_HAS_* macros to always be defined (PR #71002)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 19 04:34:30 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 42204c94ba9fcb0b4b1335e648ce140a3eef8a9d..60d7c680220233c072b274f62fdc63e1573c5813 libcxx/utils/generate_feature_test_macro_components.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- generate_feature_test_macro_components.py	2023-11-19 12:31:51.000000 +0000
+++ generate_feature_test_macro_components.py	2023-11-19 12:34:22.832546 +0000
@@ -86,14 +86,14 @@
             "headers": ["memory"],
         },
         {
             "name": "__cpp_lib_allocate_at_least",
             "values": {
-                          "c++23": 202106,
-                          # Note LWG3887 Version macro for allocate_at_least
-                          #"c++26": 202302, # P2652R2 Disallow User Specialization of allocator_traits
-                      },
+                "c++23": 202106,
+                # Note LWG3887 Version macro for allocate_at_least
+                # "c++26": 202302, # P2652R2 Disallow User Specialization of allocator_traits
+            },
             "headers": ["memory"],
         },
         {
             "name": "__cpp_lib_allocator_traits_is_always_equal",
             "values": {"c++17": 201411},
@@ -137,11 +137,13 @@
             "headers": ["map", "set", "unordered_map", "unordered_set"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_associative_heterogeneous_insertion",
-            "values": {"c++26": 202306}, # P2363R5 Extending associative containers with the remaining heterogeneous overloads
+            "values": {
+                "c++26": 202306
+            },  # P2363R5 Extending associative containers with the remaining heterogeneous overloads
             "headers": ["map", "set", "unordered_map", "unordered_set"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_assume_aligned",
@@ -201,22 +203,22 @@
             "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC",
         },
         {
             "name": "__cpp_lib_bind_back",
             "values": {
-                          "c++23": 202202,
-                          "c++26": 202306, # P2714R1 Bind front and back to NTTP callables
-                      },
+                "c++23": 202202,
+                "c++26": 202306,  # P2714R1 Bind front and back to NTTP callables
+            },
             "headers": ["functional"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_bind_front",
             "values": {
-                          "c++20": 201907,
-                          "c++26": 202306, # P2714R1 Bind front and back to NTTP callables
-                      },
+                "c++20": 201907,
+                "c++26": 202306,  # P2714R1 Bind front and back to NTTP callables
+            },
             "headers": ["functional"],
         },
         {
             "name": "__cpp_lib_bit_cast",
             "values": {"c++20": 201806},
@@ -227,11 +229,11 @@
             "values": {"c++20": 201907},
             "headers": ["bit"],
         },
         {
             "name": "__cpp_lib_bitset",
-            "values": {"c++26": 202306}, # P2697R1 Interfacing bitset with string_view
+            "values": {"c++26": 202306},  # P2697R1 Interfacing bitset with string_view
             "headers": ["bitset"],
         },
         {
             "name": "__cpp_lib_bool_constant",
             "values": {"c++17": 201505},
@@ -274,13 +276,13 @@
             "libcxx_guard": "!defined(_LIBCPP_HAS_NO_CHAR8_T)",
         },
         {
             "name": "__cpp_lib_chrono",
             "values": {
-                          "c++17": 201611,
-                          #"c++26": 202306, # P2592R3 Hashing support for std::chrono value classes
-                      },
+                "c++17": 201611,
+                # "c++26": 202306, # P2592R3 Hashing support for std::chrono value classes
+            },
             "headers": ["chrono"],
         },
         {
             "name": "__cpp_lib_chrono_udls",
             "values": {"c++14": 201304},
@@ -302,13 +304,13 @@
             "headers": ["concepts"],
         },
         {
             "name": "__cpp_lib_constexpr_algorithms",
             "values": {
-                          "c++20": 201806,
-                          #"c++26": 202306, # P2562R1 constexpr Stable Sorting
-                      },
+                "c++20": 201806,
+                # "c++26": 202306, # P2562R1 constexpr Stable Sorting
+            },
             "headers": ["algorithm", "utility"],
         },
         {
             "name": "__cpp_lib_constexpr_bitset",
             "values": {"c++23": 202207},
@@ -385,11 +387,11 @@
             "values": {"c++20": 201907},
             "headers": ["vector"],
         },
         {
             "name": "__cpp_lib_copyable_function",
-            "values": {"c++26": 202306}, # P2548R6 copyable_function
+            "values": {"c++26": 202306},  # P2548R6 copyable_function
             "headers": ["functional"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_coroutine",
@@ -483,17 +485,19 @@
             "values": {"c++23": 202207},
             "headers": ["utility"],
         },
         {
             "name": "__cpp_lib_fstream_native_handle",
-            "values": {"c++26": 202306}, # P1759R6 Native handles and file streams
+            "values": {"c++26": 202306},  # P1759R6 Native handles and file streams
             "headers": ["fstream"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_function_ref",
-            "values": {"c++26": 202306}, # P0792R14 function_ref: a type-erased callable reference
+            "values": {
+                "c++26": 202306
+            },  # P0792R14 function_ref: a type-erased callable reference
             "headers": ["functional"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_gcd_lcm",
@@ -523,11 +527,13 @@
             "headers": ["type_traits"],
         },
         {
             "name": "__cpp_lib_hazard_pointer",
             "values": {"c++26": 202306},  # P2530R3 Hazard Pointers for C++26
-            "headers": ["hazard_pointer"],# TODO verify this entry since the paper was underspecified.
+            "headers": [
+                "hazard_pointer"
+            ],  # TODO verify this entry since the paper was underspecified.
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_hypot",
             "values": {"c++17": 201603},
@@ -732,13 +738,13 @@
             ],
         },
         {
             "name": "__cpp_lib_not_fn",
             "values": {
-                          "c++17": 201603,
-                          #"c++26": 202306, # P2714R1 Bind front and back to NTTP callables
-                      },
+                "c++17": 201603,
+                # "c++26": 202306, # P2714R1 Bind front and back to NTTP callables
+            },
             "headers": ["functional"],
         },
         {
             "name": "__cpp_lib_null_iterators",
             "values": {"c++14": 201304},
@@ -812,11 +818,11 @@
             "headers": ["ranges"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_ranges_repeat",
-            "values": { "c++23": 202207},
+            "values": {"c++23": 202207},
             "headers": ["ranges"],
         },
         {
             "name": "__cpp_lib_ranges_slide",
             "values": {"c++23": 202202},
@@ -853,22 +859,24 @@
             "headers": ["ranges", "tuple", "utility"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_ratio",
-            "values": {"c++26": 202306}, # P2734R0 Adding the new SI prefixes
+            "values": {"c++26": 202306},  # P2734R0 Adding the new SI prefixes
             "headers": ["ratio"],
         },
         {
             "name": "__cpp_lib_raw_memory_algorithms",
             "values": {"c++17": 201606},
             "headers": ["memory"],
         },
         {
             "name": "__cpp_lib_rcu",
-            "values": {"c++26": 202306}, # P2545R4 Read-Copy Update (RCU)
-            "headers": ["rcu"],          # TODO verify this entry since the paper was underspecified.
+            "values": {"c++26": 202306},  # P2545R4 Read-Copy Update (RCU)
+            "headers": [
+                "rcu"
+            ],  # TODO verify this entry since the paper was underspecified.
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_reference_from_temporary",
             "values": {"c++23": 202202},
@@ -942,11 +950,13 @@
             "headers": ["memory"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_smart_ptr_owner_equality",
-            "values": {"c++26": 202306}, # P1901R2 Enabling the Use of weak_ptr as Keys in Unordered Associative Containers
+            "values": {
+                "c++26": 202306
+            },  # P1901R2 Enabling the Use of weak_ptr as Keys in Unordered Associative Containers
             "headers": ["memory"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_source_location",
@@ -971,11 +981,13 @@
             "values": {"c++20": 201902},
             "headers": ["iterator"],
         },
         {
             "name": "__cpp_lib_sstream_from_string_view",
-            "values": {"c++26": 202306},  # P2495R3 Interfacing stringstreams with string_view
+            "values": {
+                "c++26": 202306
+            },  # P2495R3 Interfacing stringstreams with string_view
             "headers": ["sstream"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_stacktrace",
@@ -1013,11 +1025,11 @@
             "values": {"c++17": 201606, "c++20": 201803},
             "headers": ["string", "string_view"],
         },
         {
             "name": "__cpp_lib_submdspan",
-            "values": {"c++26": 202306}, # P2630R4 submdspan
+            "values": {"c++26": 202306},  # P2630R4 submdspan
             "headers": ["mdspan"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_syncbuf",
@@ -1026,11 +1038,13 @@
             "test_suite_guard": "!defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)",
             "libcxx_guard": "!defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)",
         },
         {
             "name": "__cpp_lib_text_encoding",
-            "values": {"c++26": 202306}, # P1885R12 Naming Text Encodings to Demystify Them
+            "values": {
+                "c++26": 202306
+            },  # P1885R12 Naming Text Encodings to Demystify Them
             "headers": ["text_encoding"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_three_way_comparison",
@@ -1049,19 +1063,19 @@
             "headers": ["array"],
         },
         {
             "name": "__cpp_lib_to_chars",
             "values": {
-                         "c++17": 201611,
-                         "c++26": 202306, # P2497R0 Testing for success or failure of <charconv> functions
-                      },
+                "c++17": 201611,
+                "c++26": 202306,  # P2497R0 Testing for success or failure of <charconv> functions
+            },
             "headers": ["charconv"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_to_string",
-            "values": {"c++23": 202306}, # P2587R3 to_string or not to_string
+            "values": {"c++23": 202306},  # P2587R3 to_string or not to_string
             "headers": ["string"],
             "unimplemented": True,
         },
         {
             "name": "__cpp_lib_to_underlying",
@@ -1128,11 +1142,13 @@
             "values": {"c++17": 201411},
             "headers": ["type_traits"],
         },
         {
             "name": "__cpp_lib_within_lifetime",
-            "values": {"c++26": 202306}, # P2641R4 Checking if a union alternative is active
+            "values": {
+                "c++26": 202306
+            },  # P2641R4 Checking if a union alternative is active
             "headers": ["type_traits"],
             "unimplemented": True,
         },
     ]
 ]

``````````

</details>


https://github.com/llvm/llvm-project/pull/71002


More information about the libcxx-commits mailing list