]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use 202100L as feature test check for C++23
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 Nov 2023 19:22:47 +0000 (19:22 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 16 Nov 2023 08:00:36 +0000 (08:00 +0000)
I noticed that our C++23 features were not being defined when using
Clang 16 with -std=c++2b, because it only defines __cplusplus=202101L
but <bits/version.h> uses 202302L since my r14-3252-g0c316669b092fb
change.

This changes <bits/version.h> to use 202100 instead of the final 202302
value so that we support Clang 16's -std=c++2b mode.

libstdc++-v3/ChangeLog:

* include/bits/version.def (stds): Use >= 202100 for C++23
condition.
* include/bits/version.h: Regenerate.
* include/std/thread: Use > C++20 instead of >= C++23 for
__cplusplus condition.

libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/thread

index 8f008f9048fc59b24fb7133ac771c366a3b45f7b..2aab9426ecc12faeddb952ce642facbb09a3ff36 100644 (file)
@@ -1640,7 +1640,7 @@ stds[11] = ">= 201103L";
 stds[14] = ">= 201402L";
 stds[17] = ">= 201703L";
 stds[20] = ">= 202002L";
-stds[23] = ">= 202302L";
+stds[23] = ">= 202100L"; // Should be 202302L but Clang 16 uses 202101L
 stds[26] = ">  202302L"; // TODO: update when finalized
 
 // Local Variables:
index b6cb8906b4dc89832c075caf0c5b0b07fbe09973..6829c70cf48b8f9ac094b864e7579c92d9ccc042 100644 (file)
 
 // from version.def line 813
 #if !defined(__cpp_lib_optional)
-# if (__cplusplus >= 202302L) && (__glibcxx_concepts)
+# if (__cplusplus >= 202100L) && (__glibcxx_concepts)
 #  define __glibcxx_optional 202110L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_optional)
 #   define __cpp_lib_optional 202110L
 
 // from version.def line 1053
 #if !defined(__cpp_lib_ranges)
-# if (__cplusplus >= 202302L) && (__glibcxx_concepts)
+# if (__cplusplus >= 202100L) && (__glibcxx_concepts)
 #  define __glibcxx_ranges 202211L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges)
 #   define __cpp_lib_ranges 202211L
 
 // from version.def line 1099
 #if !defined(__cpp_lib_constexpr_memory)
-# if (__cplusplus >= 202302L) && (__cpp_constexpr_dynamic_alloc)
+# if (__cplusplus >= 202100L) && (__cpp_constexpr_dynamic_alloc)
 #  define __glibcxx_constexpr_memory 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_memory)
 #   define __cpp_lib_constexpr_memory 202202L
 
 // from version.def line 1314
 #if !defined(__cpp_lib_byteswap)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_byteswap 202110L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_byteswap)
 #   define __cpp_lib_byteswap 202110L
 
 // from version.def line 1322
 #if !defined(__cpp_lib_constexpr_charconv)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_constexpr_charconv 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_charconv)
 #   define __cpp_lib_constexpr_charconv 202207L
 
 // from version.def line 1330
 #if !defined(__cpp_lib_constexpr_typeinfo)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_constexpr_typeinfo 202106L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_typeinfo)
 #   define __cpp_lib_constexpr_typeinfo 202106L
 
 // from version.def line 1338
 #if !defined(__cpp_lib_expected)
-# if (__cplusplus >= 202302L) && (__cpp_concepts >= 202002L)
+# if (__cplusplus >= 202100L) && (__cpp_concepts >= 202002L)
 #  define __glibcxx_expected 202211L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_expected)
 #   define __cpp_lib_expected 202211L
 
 // from version.def line 1347
 #if !defined(__cpp_lib_invoke_r)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_invoke_r 202106L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_invoke_r)
 #   define __cpp_lib_invoke_r 202106L
 
 // from version.def line 1355
 #if !defined(__cpp_lib_is_scoped_enum)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_is_scoped_enum 202011L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_is_scoped_enum)
 #   define __cpp_lib_is_scoped_enum 202011L
 
 // from version.def line 1363
 #if !defined(__cpp_lib_reference_from_temporary)
-# if (__cplusplus >= 202302L) && (__has_builtin(__reference_constructs_from_temporary) && __has_builtin(__reference_converts_from_temporary))
+# if (__cplusplus >= 202100L) && (__has_builtin(__reference_constructs_from_temporary) && __has_builtin(__reference_converts_from_temporary))
 #  define __glibcxx_reference_from_temporary 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_reference_from_temporary)
 #   define __cpp_lib_reference_from_temporary 202202L
 
 // from version.def line 1374
 #if !defined(__cpp_lib_to_underlying)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_to_underlying 202102L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_to_underlying)
 #   define __cpp_lib_to_underlying 202102L
 
 // from version.def line 1382
 #if !defined(__cpp_lib_unreachable)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_unreachable 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_unreachable)
 #   define __cpp_lib_unreachable 202202L
 
 // from version.def line 1390
 #if !defined(__cpp_lib_ranges_zip)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_zip 202110L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_zip)
 #   define __cpp_lib_ranges_zip 202110L
 
 // from version.def line 1398
 #if !defined(__cpp_lib_ranges_chunk)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_chunk 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_chunk)
 #   define __cpp_lib_ranges_chunk 202202L
 
 // from version.def line 1406
 #if !defined(__cpp_lib_ranges_slide)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_slide 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_slide)
 #   define __cpp_lib_ranges_slide 202202L
 
 // from version.def line 1414
 #if !defined(__cpp_lib_ranges_chunk_by)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_chunk_by 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_chunk_by)
 #   define __cpp_lib_ranges_chunk_by 202202L
 
 // from version.def line 1422
 #if !defined(__cpp_lib_ranges_join_with)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_join_with 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_join_with)
 #   define __cpp_lib_ranges_join_with 202202L
 
 // from version.def line 1430
 #if !defined(__cpp_lib_ranges_repeat)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_repeat 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_repeat)
 #   define __cpp_lib_ranges_repeat 202207L
 
 // from version.def line 1438
 #if !defined(__cpp_lib_ranges_stride)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_stride 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_stride)
 #   define __cpp_lib_ranges_stride 202207L
 
 // from version.def line 1446
 #if !defined(__cpp_lib_ranges_cartesian_product)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_cartesian_product 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_cartesian_product)
 #   define __cpp_lib_ranges_cartesian_product 202207L
 
 // from version.def line 1454
 #if !defined(__cpp_lib_ranges_as_rvalue)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_as_rvalue 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_as_rvalue)
 #   define __cpp_lib_ranges_as_rvalue 202207L
 
 // from version.def line 1462
 #if !defined(__cpp_lib_ranges_as_const)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_as_const 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_as_const)
 #   define __cpp_lib_ranges_as_const 202207L
 
 // from version.def line 1470
 #if !defined(__cpp_lib_ranges_enumerate)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_enumerate 202302L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_enumerate)
 #   define __cpp_lib_ranges_enumerate 202302L
 
 // from version.def line 1478
 #if !defined(__cpp_lib_ranges_fold)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_fold 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_fold)
 #   define __cpp_lib_ranges_fold 202207L
 
 // from version.def line 1486
 #if !defined(__cpp_lib_ranges_contains)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_contains 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_contains)
 #   define __cpp_lib_ranges_contains 202207L
 
 // from version.def line 1494
 #if !defined(__cpp_lib_ranges_iota)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_iota 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_iota)
 #   define __cpp_lib_ranges_iota 202202L
 
 // from version.def line 1502
 #if !defined(__cpp_lib_ranges_find_last)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_ranges_find_last 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ranges_find_last)
 #   define __cpp_lib_ranges_find_last 202207L
 
 // from version.def line 1510
 #if !defined(__cpp_lib_constexpr_bitset)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED && (__cpp_constexpr_dynamic_alloc)
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED && (__cpp_constexpr_dynamic_alloc)
 #  define __glibcxx_constexpr_bitset 202202L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_bitset)
 #   define __cpp_lib_constexpr_bitset 202202L
 
 // from version.def line 1520
 #if !defined(__cpp_lib_stdatomic_h)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_stdatomic_h 202011L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_stdatomic_h)
 #   define __cpp_lib_stdatomic_h 202011L
 
 // from version.def line 1528
 #if !defined(__cpp_lib_adaptor_iterator_pair_constructor)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_adaptor_iterator_pair_constructor 202106L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_adaptor_iterator_pair_constructor)
 #   define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 
 // from version.def line 1537
 #if !defined(__cpp_lib_formatters)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_formatters 202302L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_formatters)
 #   define __cpp_lib_formatters 202302L
 
 // from version.def line 1546
 #if !defined(__cpp_lib_forward_like)
-# if (__cplusplus >= 202302L)
+# if (__cplusplus >= 202100L)
 #  define __glibcxx_forward_like 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_forward_like)
 #   define __cpp_lib_forward_like 202207L
 
 // from version.def line 1554
 #if !defined(__cpp_lib_ios_noreplace)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_ios_noreplace 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_ios_noreplace)
 #   define __cpp_lib_ios_noreplace 202207L
 
 // from version.def line 1563
 #if !defined(__cpp_lib_move_only_function)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_move_only_function 202110L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_move_only_function)
 #   define __cpp_lib_move_only_function 202110L
 
 // from version.def line 1572
 #if !defined(__cpp_lib_spanstream)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED && (__glibcxx_span)
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED && (__glibcxx_span)
 #  define __glibcxx_spanstream 202106L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_spanstream)
 #   define __cpp_lib_spanstream 202106L
 
 // from version.def line 1582
 #if !defined(__cpp_lib_stacktrace)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED && (_GLIBCXX_HAVE_STACKTRACE)
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED && (_GLIBCXX_HAVE_STACKTRACE)
 #  define __glibcxx_stacktrace 202011L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_stacktrace)
 #   define __cpp_lib_stacktrace 202011L
 
 // from version.def line 1592
 #if !defined(__cpp_lib_string_contains)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_string_contains 202011L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_string_contains)
 #   define __cpp_lib_string_contains 202011L
 
 // from version.def line 1601
 #if !defined(__cpp_lib_string_resize_and_overwrite)
-# if (__cplusplus >= 202302L) && _GLIBCXX_HOSTED
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
 #  define __glibcxx_string_resize_and_overwrite 202110L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_string_resize_and_overwrite)
 #   define __cpp_lib_string_resize_and_overwrite 202110L
index c182a4d56c1de9782fdca0a640447757a55bcad0..39042d7cdf55dc58295a245bc71b71f9cf41e567 100644 (file)
@@ -42,7 +42,7 @@
 # include <stop_token> // std::stop_source, std::stop_token, std::nostopstate
 #endif
 
-#if __cplusplus >= 202302L
+#if __cplusplus > 202002L
 # include <format>
 #endif