-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
[libc++] Adjust the version of __cpp_lib_ranges in C++20 mode #109324
Open
ldionne
wants to merge
1
commit into
llvm:release/19.x
Choose a base branch
from
ldionne:review/llvm-19-ranges-ftm
base: release/19.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−46
Conversation
This file contains 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
This is a (very partial) cherry-pick of llvm#101715 to fix this oversight in the LLVM 19 release.
llvmbot
added
the
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
label
Sep 19, 2024
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesThis is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release. Full diff: https://github.com/llvm/llvm-project/pull/109324.diff 9 Files Affected:
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index a1506e115fe70f..4d532e2bd7319e 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_polymorphic_allocator`` ``201902L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_ranges`` ``202207L``
+ ``__cpp_lib_ranges`` ``202110L``
---------------------------------------------------------- -----------------
``__cpp_lib_remove_cvref`` ``201711L``
---------------------------------------------------------- -----------------
diff --git a/libcxx/include/version b/libcxx/include/version
index fe64343eafbc9c..f53557bbe23d8a 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -182,7 +182,7 @@ __cpp_lib_philox_engine 202406L <random>
__cpp_lib_polymorphic_allocator 201902L <memory_resource>
__cpp_lib_print 202207L <ostream> <print>
__cpp_lib_quoted_string_io 201304L <iomanip>
-__cpp_lib_ranges 202207L <algorithm> <functional> <iterator>
+__cpp_lib_ranges 202110L <algorithm> <functional> <iterator>
<memory> <ranges>
__cpp_lib_ranges_as_const 202207L <ranges>
__cpp_lib_ranges_as_rvalue 202207L <ranges>
@@ -428,7 +428,7 @@ __cpp_lib_void_t 201411L <type_traits>
# if _LIBCPP_AVAILABILITY_HAS_PMR
# define __cpp_lib_polymorphic_allocator 201902L
# endif
-# define __cpp_lib_ranges 202207L
+# define __cpp_lib_ranges 202110L
# define __cpp_lib_remove_cvref 201711L
# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
# define __cpp_lib_semaphore 201907L
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
index ded80060632419..932dea1c5cf007 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -21,7 +21,7 @@
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
__cpp_lib_freestanding_algorithm 202311L [C++26]
__cpp_lib_parallel_algorithm 201603L [C++17]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_ranges_contains 202207L [C++23]
__cpp_lib_ranges_find_last 202207L [C++23]
__cpp_lib_ranges_starts_ends_with 202106L [C++23]
@@ -244,8 +244,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifdef __cpp_lib_ranges_contains
@@ -321,8 +321,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# ifndef __cpp_lib_ranges_contains
@@ -425,8 +425,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# endif
# ifndef __cpp_lib_ranges_contains
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
index 27e76e5b2b05a3..0619424fdbda1c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
@@ -27,7 +27,7 @@
__cpp_lib_invoke_r 202106L [C++23]
__cpp_lib_move_only_function 202110L [C++23]
__cpp_lib_not_fn 201603L [C++17]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_reference_wrapper 202403L [C++26]
__cpp_lib_result_of_sfinae 201210L [C++14]
__cpp_lib_transparent_operators 201210L [C++14]
@@ -305,8 +305,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifdef __cpp_lib_reference_wrapper
@@ -409,8 +409,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# ifdef __cpp_lib_reference_wrapper
@@ -531,8 +531,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# endif
# ifndef __cpp_lib_reference_wrapper
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
index 700907ce9bb071..228b530dd32288 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
@@ -23,7 +23,7 @@
__cpp_lib_move_iterator_concept 202207L [C++20]
__cpp_lib_nonmember_container_access 201411L [C++17]
__cpp_lib_null_iterators 201304L [C++14]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_ssize 201902L [C++20]
*/
@@ -197,8 +197,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifndef __cpp_lib_ssize
@@ -255,8 +255,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# ifndef __cpp_lib_ssize
@@ -313,8 +313,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# endif
# ifndef __cpp_lib_ssize
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
index aa1170658b103a..58f0ad7eaa41dc 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
@@ -28,7 +28,7 @@
__cpp_lib_make_unique 201304L [C++14]
__cpp_lib_out_ptr 202106L [C++23]
202311L [C++26]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_raw_memory_algorithms 201606L [C++17]
__cpp_lib_shared_ptr_arrays 201611L [C++17]
201707L [C++20]
@@ -364,8 +364,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifndef __cpp_lib_raw_memory_algorithms
@@ -495,8 +495,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# ifndef __cpp_lib_raw_memory_algorithms
@@ -626,8 +626,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# endif
# ifndef __cpp_lib_raw_memory_algorithms
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
index 30feacd796d8e1..4fe971d9909e3f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
@@ -17,7 +17,7 @@
/* Constant Value
__cpp_lib_default_template_type_for_algorithm_values 202403L [C++26]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_ranges_as_const 202207L [C++23]
__cpp_lib_ranges_as_rvalue 202207L [C++23]
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -192,8 +192,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifdef __cpp_lib_ranges_as_const
@@ -245,8 +245,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# if !defined(_LIBCPP_VERSION)
@@ -364,8 +364,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
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 b8bad696f1bae0..0b065760d95596 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
@@ -166,7 +166,7 @@
__cpp_lib_polymorphic_allocator 201902L [C++20]
__cpp_lib_print 202207L [C++23]
__cpp_lib_quoted_string_io 201304L [C++14]
- __cpp_lib_ranges 202207L [C++20]
+ __cpp_lib_ranges 202110L [C++20]
__cpp_lib_ranges_as_const 202207L [C++23]
__cpp_lib_ranges_as_rvalue 202207L [C++23]
__cpp_lib_ranges_chunk 202202L [C++23]
@@ -4131,8 +4131,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++20"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++20"
# endif
# ifdef __cpp_lib_ranges_as_const
@@ -5619,8 +5619,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++23"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++23"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++23"
# endif
# if !defined(_LIBCPP_VERSION)
@@ -7470,8 +7470,8 @@
# ifndef __cpp_lib_ranges
# error "__cpp_lib_ranges should be defined in c++26"
# endif
-# if __cpp_lib_ranges != 202207L
-# error "__cpp_lib_ranges should have the value 202207L in c++26"
+# if __cpp_lib_ranges != 202110L
+# error "__cpp_lib_ranges should have the value 202110L in c++26"
# 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 6c42748002aee3..be897eb160e7c4 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -991,7 +991,7 @@ def add_version_header(tc):
{
"name": "__cpp_lib_ranges",
"values": {
- "c++20": 202207,
+ "c++20": 202110, # P2415R2 What is a view?
# "c++23": 202302, # Relaxing Ranges Just A Smidge
# "c++26": 202406, # P2997R1 Removing the common reference requirement from the indirectly invocable concepts (already implemented as a DR)
},
|
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.
This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release.