-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libc++] Adds headers to FTM. #75699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
philnik777
merged 1 commit into
llvm:main
from
mordante:add_feature_test_macros_to_a_header
Dec 18, 2023
Merged
[libc++] Adds headers to FTM. #75699
philnik777
merged 1 commit into
llvm:main
from
mordante:add_feature_test_macros_to_a_header
Dec 18, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These feature-test macros had no headers listed in their associated papers. This adds the expected headers. Fixes llvm#75577
@llvm/pr-subscribers-libcxx Author: Mark de Wever (mordante) ChangesThese feature-test macros had no headers listed in their associated papers. This adds the expected headers. Fixes #75577 Full diff: https://github.com/llvm/llvm-project/pull/75699.diff 5 Files Affected:
diff --git a/libcxx/include/version b/libcxx/include/version
index a91c344c436090..7aa002e257b0a1 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -93,7 +93,7 @@ __cpp_lib_expected 202211L <expected>
__cpp_lib_filesystem 201703L <filesystem>
__cpp_lib_format 202106L <format>
__cpp_lib_format_ranges 202207L <format>
-__cpp_lib_format_uchar 202311L <>
+__cpp_lib_format_uchar 202311L <format>
__cpp_lib_formatters 202302L <stacktrace> <thread>
__cpp_lib_forward_like 202207L <utility>
__cpp_lib_freestanding_algorithm 202311L <algorithm>
@@ -188,7 +188,7 @@ __cpp_lib_remove_cvref 201711L <type_traits>
__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
__cpp_lib_sample 201603L <algorithm>
-__cpp_lib_saturation_arithmetic 202311L <>
+__cpp_lib_saturation_arithmetic 202311L <numeric>
__cpp_lib_scoped_lock 201703L <mutex>
__cpp_lib_semaphore 201907L <semaphore>
__cpp_lib_shared_mutex 201505L <shared_mutex>
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/.version.compile.pass.cpp
deleted file mode 100644
index 2486985cefaca0..00000000000000
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/.version.compile.pass.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// WARNING: This test was generated by generate_feature_test_macro_components.py
-// and should not be edited manually.
-//
-// clang-format off
-
-// <>
-
-// Test the feature test macros defined by <>
-
-/* Constant Value
- __cpp_lib_format_uchar 202311L [C++20]
- __cpp_lib_saturation_arithmetic 202311L [C++26]
-*/
-
-#include <>
-#include "test_macros.h"
-
-#if TEST_STD_VER < 14
-
-# ifdef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-#elif TEST_STD_VER == 14
-
-# ifdef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-#elif TEST_STD_VER == 17
-
-# ifdef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should not be defined before c++20"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-#elif TEST_STD_VER == 20
-
-# ifndef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should be defined in c++20"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-# error "__cpp_lib_format_uchar should have the value 202311L in c++20"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-#elif TEST_STD_VER == 23
-
-# ifndef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should be defined in c++23"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-# error "__cpp_lib_format_uchar should have the value 202311L in c++23"
-# endif
-
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
-# endif
-
-#elif TEST_STD_VER > 23
-
-# ifndef __cpp_lib_format_uchar
-# error "__cpp_lib_format_uchar should be defined in c++26"
-# endif
-# if __cpp_lib_format_uchar != 202311L
-# error "__cpp_lib_format_uchar should have the value 202311L in c++26"
-# endif
-
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should be defined in c++26"
-# endif
-# if __cpp_lib_saturation_arithmetic != 202311L
-# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_saturation_arithmetic
-# error "__cpp_lib_saturation_arithmetic should not be defined because it is unimplemented in libc++!"
-# endif
-# endif
-
-#endif // TEST_STD_VER > 23
-
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
index 4e2c50483c2298..aa7b2f4286827b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
@@ -18,6 +18,7 @@
/* Constant Value
__cpp_lib_format 202106L [C++20]
__cpp_lib_format_ranges 202207L [C++23]
+ __cpp_lib_format_uchar 202311L [C++20]
*/
#include <format>
@@ -33,6 +34,10 @@
# error "__cpp_lib_format_ranges should not be defined before c++23"
# endif
+# ifdef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should not be defined before c++20"
+# endif
+
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_format
@@ -43,6 +48,10 @@
# error "__cpp_lib_format_ranges should not be defined before c++23"
# endif
+# ifdef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should not be defined before c++20"
+# endif
+
#elif TEST_STD_VER == 17
# ifdef __cpp_lib_format
@@ -53,6 +62,10 @@
# error "__cpp_lib_format_ranges should not be defined before c++23"
# endif
+# ifdef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should not be defined before c++20"
+# endif
+
#elif TEST_STD_VER == 20
# if !defined(_LIBCPP_VERSION)
@@ -72,6 +85,13 @@
# error "__cpp_lib_format_ranges should not be defined before c++23"
# endif
+# ifndef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should be defined in c++20"
+# endif
+# if __cpp_lib_format_uchar != 202311L
+# error "__cpp_lib_format_uchar should have the value 202311L in c++20"
+# endif
+
#elif TEST_STD_VER == 23
# if !defined(_LIBCPP_VERSION)
@@ -94,6 +114,13 @@
# error "__cpp_lib_format_ranges should have the value 202207L in c++23"
# endif
+# ifndef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should be defined in c++23"
+# endif
+# if __cpp_lib_format_uchar != 202311L
+# error "__cpp_lib_format_uchar should have the value 202311L in c++23"
+# endif
+
#elif TEST_STD_VER > 23
# if !defined(_LIBCPP_VERSION)
@@ -116,5 +143,12 @@
# error "__cpp_lib_format_ranges should have the value 202207L in c++26"
# endif
+# ifndef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should be defined in c++26"
+# endif
+# if __cpp_lib_format_uchar != 202311L
+# error "__cpp_lib_format_uchar should have the value 202311L in c++26"
+# endif
+
#endif // TEST_STD_VER > 23
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
index 60004b06c5ff52..b510eefc69a5d3 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
@@ -15,12 +15,13 @@
// Test the feature test macros defined by <numeric>
-/* Constant Value
- __cpp_lib_constexpr_numeric 201911L [C++20]
- __cpp_lib_gcd_lcm 201606L [C++17]
- __cpp_lib_interpolate 201902L [C++20]
- __cpp_lib_parallel_algorithm 201603L [C++17]
- __cpp_lib_ranges_iota 202202L [C++23]
+/* Constant Value
+ __cpp_lib_constexpr_numeric 201911L [C++20]
+ __cpp_lib_gcd_lcm 201606L [C++17]
+ __cpp_lib_interpolate 201902L [C++20]
+ __cpp_lib_parallel_algorithm 201603L [C++17]
+ __cpp_lib_ranges_iota 202202L [C++23]
+ __cpp_lib_saturation_arithmetic 202311L [C++26]
*/
#include <numeric>
@@ -48,6 +49,10 @@
# error "__cpp_lib_ranges_iota should not be defined before c++23"
# endif
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+# endif
+
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_constexpr_numeric
@@ -70,6 +75,10 @@
# error "__cpp_lib_ranges_iota should not be defined before c++23"
# endif
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+# endif
+
#elif TEST_STD_VER == 17
# ifdef __cpp_lib_constexpr_numeric
@@ -104,6 +113,10 @@
# error "__cpp_lib_ranges_iota should not be defined before c++23"
# endif
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+# endif
+
#elif TEST_STD_VER == 20
# ifndef __cpp_lib_constexpr_numeric
@@ -144,6 +157,10 @@
# error "__cpp_lib_ranges_iota should not be defined before c++23"
# endif
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+# endif
+
#elif TEST_STD_VER == 23
# ifndef __cpp_lib_constexpr_numeric
@@ -193,6 +210,10 @@
# endif
# endif
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
+# endif
+
#elif TEST_STD_VER > 23
# ifndef __cpp_lib_constexpr_numeric
@@ -242,5 +263,18 @@
# endif
# endif
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should be defined in c++26"
+# endif
+# if __cpp_lib_saturation_arithmetic != 202311L
+# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"
+# endif
+# else // _LIBCPP_VERSION
+# ifdef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
#endif // TEST_STD_VER > 23
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 6a30324397883a..70e18b6dde006e 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -486,7 +486,9 @@ def add_version_header(tc):
"values": {
"c++20": 202311 # DR P2909R4 Fix formatting of code units as integers
},
- "headers": [""], # Note not in format
+ "headers": [
+ "format" # TODO verify this entry since the paper was underspecified.
+ ],
},
{
"name": "__cpp_lib_formatters",
@@ -660,7 +662,7 @@ def add_version_header(tc):
},
{
"name": "__cpp_lib_ios_noreplace",
- "values": { "c++23": 202207 },
+ "values": {"c++23": 202207},
"headers": ["ios"],
},
{
@@ -1010,7 +1012,9 @@ def add_version_header(tc):
{
"name": "__cpp_lib_saturation_arithmetic",
"values": {"c++26": 202311}, # P0543R3 Saturation arithmetic
- "headers": [""], # Note not in <numerics>
+ "headers": [
+ "numeric" # TODO verify this entry since the paper was underspecified.
+ ],
"unimplemented": True,
},
{
|
philnik777
approved these changes
Dec 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These feature-test macros had no headers listed in their associated papers. This adds the expected headers.
Fixes #75577