Skip to content

release/20.x: [libc++][format] Disables the FTM on older MacOS versions. (#126547) #127232

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
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libcxx/include/version
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_erase_if 202002L
# undef __cpp_lib_execution
// # define __cpp_lib_execution 201902L
# define __cpp_lib_format 202110L
# if _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# define __cpp_lib_format 202110L
# endif
# define __cpp_lib_format_uchar 202311L
# define __cpp_lib_generic_unordered_lookup 201811L
# define __cpp_lib_int_pow2 202002L
Expand Down Expand Up @@ -499,7 +501,9 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_optional
# define __cpp_lib_optional 202110L
# define __cpp_lib_out_ptr 202106L
# define __cpp_lib_print 202207L
# if _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# define __cpp_lib_print 202207L
# endif
# undef __cpp_lib_ranges
# define __cpp_lib_ranges 202406L
// # define __cpp_lib_ranges_as_const 202207L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,17 @@

#elif TEST_STD_VER == 20

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++20"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++20"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++20"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++20"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# ifdef __cpp_lib_format_ranges
Expand All @@ -88,11 +94,17 @@

#elif TEST_STD_VER == 23

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++23"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++23"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++23"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++23"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# ifndef __cpp_lib_format_ranges
Expand All @@ -111,11 +123,17 @@

#elif TEST_STD_VER > 23

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++26"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++26"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++26"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++26"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# ifndef __cpp_lib_format_ranges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@
# endif
# endif

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

#elif TEST_STD_VER > 23
Expand All @@ -111,11 +117,17 @@
# endif
# endif

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

#endif // TEST_STD_VER > 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,32 @@

#elif TEST_STD_VER == 23

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

#elif TEST_STD_VER > 23

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

#endif // TEST_STD_VER > 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3685,11 +3685,17 @@
# error "__cpp_lib_flat_set should not be defined before c++23"
# endif

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++20"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++20"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++20"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++20"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# ifdef __cpp_lib_format_path
Expand Down Expand Up @@ -5146,11 +5152,17 @@
# endif
# endif

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++23"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++23"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++23"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++23"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# ifdef __cpp_lib_format_path
Expand Down Expand Up @@ -5679,11 +5691,17 @@
# endif
# endif

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++23"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++23"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
Expand Down Expand Up @@ -6853,11 +6871,17 @@
# endif
# endif

# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++26"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++26"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
# error "__cpp_lib_format should be defined in c++26"
# endif
# if __cpp_lib_format != 202110L
# error "__cpp_lib_format should have the value 202110L in c++26"
# endif
# else
# ifdef __cpp_lib_format
# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down Expand Up @@ -7557,11 +7581,17 @@
# endif
# endif

# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
# error "__cpp_lib_print should be defined in c++26"
# endif
# if __cpp_lib_print != 202207L
# error "__cpp_lib_print should have the value 202207L in c++26"
# endif
# else
# ifdef __cpp_lib_print
# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
# endif
# endif

# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
Expand Down
10 changes: 10 additions & 0 deletions libcxx/utils/generate_feature_test_macro_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ def add_version_header(tc):
# 202305 P2757R3 Type-checking format args
# 202306 P2637R3 Member Visit
"headers": ["format"],
# Trying to use `std::format` where to_chars floating-point is not
# available causes compilation errors, even with non floating-point types.
# https://github.com/llvm/llvm-project/issues/125353
"test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT",
"libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT",
},
{
"name": "__cpp_lib_format_path",
Expand Down Expand Up @@ -1004,6 +1009,11 @@ def add_version_header(tc):
# "c++26": 202406, # P3235R3 std::print more types faster with less memory
},
"headers": ["ostream", "print"],
# Trying to use `std::print` where to_chars floating-point is not
# available causes compilation errors, even with non floating-point types.
# https://github.com/llvm/llvm-project/issues/125353
"test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT",
"libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT",
},
{
"name": "__cpp_lib_quoted_string_io",
Expand Down
Loading