Skip to content

Commit b52e35b

Browse files
Add __cpp_lib_concepts guard for __cpp_lib_move_iterator_concept (#2994)
1 parent 1fe625d commit b52e35b

File tree

9 files changed

+41
-38
lines changed

9 files changed

+41
-38
lines changed

stl/inc/algorithm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5190,7 +5190,7 @@ _FwdIt shift_right(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _P
51905190
}
51915191
#endif // _HAS_CXX20
51925192

5193-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
5193+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
51945194
namespace ranges {
51955195
class _Shift_left_fn : private _Not_quite_object {
51965196
public:

stl/inc/memory

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4114,7 +4114,7 @@ public:
41144114
};
41154115
#endif // _HAS_CXX20
41164116

4117-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
4117+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
41184118
template <class _Ty>
41194119
struct _Pointer_of_helper {};
41204120

stl/inc/numeric

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) {
523523
}
524524
}
525525

526-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
526+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
527527
namespace ranges {
528528
template <class _Out, class _Ty>
529529
using iota_result = out_value_result<_Out, _Ty>;

stl/inc/xutility

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ _INLINE_VAR constexpr bool _Is_cpp17_random_iter_v = is_convertible_v<_Iter_cat_
861861

862862
template <class _Iter>
863863
_INLINE_VAR constexpr bool _Is_ranges_random_iter_v =
864-
#if defined(__cpp_lib_concepts)
864+
#ifdef __cpp_lib_concepts
865865
random_access_iterator<_Iter> ||
866866
#endif
867867
_Is_cpp17_random_iter_v<_Iter>;

stl/inc/yvals_core.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,13 +1386,13 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
13861386
#endif // __cpp_impl_coroutine
13871387

13881388
#if _HAS_CXX20
1389-
#if !defined(__EDG__) || defined(__INTELLISENSE__) // TRANSITION, EDG concepts support
1389+
#if !defined(__EDG__) || defined(__INTELLISENSE__) // TRANSITION, GH-395
13901390
#define __cpp_lib_concepts 202002L
13911391
#endif // !defined(__EDG__) || defined(__INTELLISENSE__)
13921392

1393-
#if defined(__cpp_lib_concepts)
1393+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
13941394
#define __cpp_lib_algorithm_iterator_requirements 202207L
1395-
#endif
1395+
#endif // __cpp_lib_concepts
13961396

13971397
#define __cpp_lib_assume_aligned 201811L
13981398
#define __cpp_lib_atomic_flag_test 201907L
@@ -1422,9 +1422,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
14221422
#define __cpp_lib_endian 201907L
14231423
#define __cpp_lib_erase_if 202002L
14241424

1425-
#if defined(__cpp_lib_concepts) // TRANSITION, GH-395
1425+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
14261426
#define __cpp_lib_format 202110L
1427-
#endif // defined(__cpp_lib_concepts)
1427+
#endif // __cpp_lib_concepts
14281428

14291429
#define __cpp_lib_generic_unordered_lookup 201811L
14301430
#define __cpp_lib_int_pow2 202002L
@@ -1450,12 +1450,16 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
14501450
#define __cpp_lib_latch 201907L
14511451
#define __cpp_lib_list_remove_return_type 201806L
14521452
#define __cpp_lib_math_constants 201907L
1453-
#define __cpp_lib_move_iterator_concept 202207L
1454-
#define __cpp_lib_polymorphic_allocator 201902L
14551453

1456-
#if defined(__cpp_lib_concepts) // TRANSITION, GH-395
1454+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
1455+
#define __cpp_lib_move_iterator_concept 202207L
1456+
#endif // __cpp_lib_concepts
1457+
1458+
#define __cpp_lib_polymorphic_allocator 201902L
1459+
1460+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
14571461
#define __cpp_lib_ranges 202110L
1458-
#endif // defined(__cpp_lib_concepts)
1462+
#endif // __cpp_lib_concepts
14591463

14601464
#define __cpp_lib_remove_cvref 201711L
14611465
#define __cpp_lib_semaphore 201907L
@@ -1551,7 +1555,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
15511555
#endif // language mode
15521556
#endif // _M_CEE
15531557

1554-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
1558+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
15551559
#define __cpp_lib_optional 202110L // P0798R8 Monadic Operations For optional
15561560
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
15571561
#define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant
@@ -1565,7 +1569,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
15651569
#define __cpp_lib_shared_ptr_arrays 201611L // P0497R0 Fixing shared_ptr For Arrays
15661570
#endif // _HAS_CXX20
15671571

1568-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
1572+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
15691573
#define __cpp_lib_shift 202202L // P2440R1 ranges::shift_left, ranges::shift_right
15701574
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
15711575
#define __cpp_lib_shift 201806L // P0769R2 shift_left(), shift_right()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Copyright (c) Microsoft Corporation.
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
#include <version> // TRANSITION, EDG support for concepts
5-
#ifdef __cpp_lib_concepts // TRANSITION, EDG support for concepts
4+
#include <version> // TRANSITION, GH-395
5+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
66

77
#include <ranges>
88

99
// Testing LWG-3330 "Include <compare> from most library headers" by intentionally NOT including <compare>
1010

1111
static_assert(std::is_eq(std::partial_ordering::equivalent));
1212

13-
#endif // TRANSITION, EDG support for concepts
13+
#endif // TRANSITION, GH-395
1414

1515
void test_ranges() {}

tests/std/tests/P0220R1_string_view/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ constexpr bool test_case_contiguous_constructor() {
343343
}
344344

345345
constexpr bool test_case_range_constructor() {
346-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
346+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
347347
const array expectedData{'n', 'o', ' ', 'n', 'u', 'l', 'l'};
348348
// Also tests the corresponding deduction guide:
349349
same_as<string_view> auto sv = basic_string_view(expectedData);

tests/std/tests/P0980R1_constexpr_strings/test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,9 @@ struct string_view_convertible {
165165
}
166166
};
167167

168-
// TRANSITION, EDG concepts support
169168
template <class Range1, class Range2>
170169
constexpr bool equalRanges(const Range1& range1, const Range2& range2) noexcept {
171-
#ifdef __cpp_lib_concepts
170+
#ifdef __cpp_lib_concepts // TRANSITION, GH-395 (equalRanges should be replaced by direct calls to ranges::equal)
172171
return ranges::equal(range1, range2);
173172
#else // ^^^ __cpp_lib_concepts ^^^ / vvv !__cpp_lib_concepts vvv
174173
return equal(begin(range1), end(range1), begin(range2), end(range2));

tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ STATIC_ASSERT(__cpp_lib_adaptor_iterator_pair_constructor == 202106L);
3030
STATIC_ASSERT(__cpp_lib_addressof_constexpr == 201603L);
3131
#endif
3232

33-
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
33+
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
3434
#ifndef __cpp_lib_algorithm_iterator_requirements
3535
#error __cpp_lib_algorithm_iterator_requirements is not defined
3636
#elif __cpp_lib_algorithm_iterator_requirements != 202207L
@@ -44,7 +44,7 @@ STATIC_ASSERT(__cpp_lib_algorithm_iterator_requirements == 202207L);
4444
#endif
4545
#endif
4646

47-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
47+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
4848
#ifndef __cpp_lib_allocate_at_least
4949
#error __cpp_lib_allocate_at_least is not defined
5050
#elif __cpp_lib_allocate_at_least != 202106L
@@ -444,7 +444,7 @@ STATIC_ASSERT(__cpp_lib_clamp == 201603L);
444444
STATIC_ASSERT(__cpp_lib_complex_udls == 201309L);
445445
#endif
446446

447-
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
447+
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, GH-395
448448
#ifndef __cpp_lib_concepts
449449
#error __cpp_lib_concepts is not defined
450450
#elif __cpp_lib_concepts != 202002L
@@ -756,7 +756,7 @@ STATIC_ASSERT(__cpp_lib_execution == 201603L);
756756
#endif
757757
#endif
758758

759-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
759+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
760760
#ifndef __cpp_lib_expected
761761
#error __cpp_lib_expected is not defined
762762
#elif __cpp_lib_expected != 202202L
@@ -800,7 +800,7 @@ STATIC_ASSERT(__cpp_lib_filesystem == 201703L);
800800
#endif
801801
#endif
802802

803-
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
803+
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
804804
#ifndef __cpp_lib_format
805805
#error __cpp_lib_format is not defined
806806
#elif __cpp_lib_format != 202110L
@@ -1274,7 +1274,7 @@ STATIC_ASSERT(__cpp_lib_memory_resource == 201603L);
12741274
#endif
12751275
#endif
12761276

1277-
#if _HAS_CXX20
1277+
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
12781278
#ifndef __cpp_lib_move_iterator_concept
12791279
#error __cpp_lib_move_iterator_concept is not defined
12801280
#elif __cpp_lib_move_iterator_concept != 202207L
@@ -1346,7 +1346,7 @@ STATIC_ASSERT(__cpp_lib_not_fn == 201603L);
13461346
STATIC_ASSERT(__cpp_lib_null_iterators == 201304L);
13471347
#endif
13481348

1349-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1349+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
13501350
#ifndef __cpp_lib_optional
13511351
#error __cpp_lib_optional is not defined
13521352
#elif __cpp_lib_optional != 202110L
@@ -1376,7 +1376,7 @@ STATIC_ASSERT(__cpp_lib_optional == 201606L);
13761376
#endif
13771377
#endif
13781378

1379-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1379+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
13801380
#ifndef __cpp_lib_out_ptr
13811381
#error __cpp_lib_out_ptr is not defined
13821382
#elif __cpp_lib_out_ptr != 202106L
@@ -1426,7 +1426,7 @@ STATIC_ASSERT(__cpp_lib_polymorphic_allocator == 201902L);
14261426
STATIC_ASSERT(__cpp_lib_quoted_string_io == 201304L);
14271427
#endif
14281428

1429-
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
1429+
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
14301430
#ifndef __cpp_lib_ranges
14311431
#error __cpp_lib_ranges is not defined
14321432
#elif __cpp_lib_ranges != 202110L
@@ -1440,7 +1440,7 @@ STATIC_ASSERT(__cpp_lib_ranges == 202110L);
14401440
#endif
14411441
#endif
14421442

1443-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1443+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
14441444
#ifndef __cpp_lib_ranges_chunk
14451445
#error __cpp_lib_ranges_chunk is not defined
14461446
#elif __cpp_lib_ranges_chunk != 202202L
@@ -1454,7 +1454,7 @@ STATIC_ASSERT(__cpp_lib_ranges_chunk == 202202L);
14541454
#endif
14551455
#endif
14561456

1457-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1457+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
14581458
#ifndef __cpp_lib_ranges_chunk_by
14591459
#error __cpp_lib_ranges_chunk_by is not defined
14601460
#elif __cpp_lib_ranges_chunk_by != 202202L
@@ -1468,7 +1468,7 @@ STATIC_ASSERT(__cpp_lib_ranges_chunk_by == 202202L);
14681468
#endif
14691469
#endif
14701470

1471-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1471+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
14721472
#ifndef __cpp_lib_ranges_contains
14731473
#error __cpp_lib_ranges_contains is not defined
14741474
#elif __cpp_lib_ranges_contains != 202207L
@@ -1482,7 +1482,7 @@ STATIC_ASSERT(__cpp_lib_ranges_contains == 202207L);
14821482
#endif
14831483
#endif
14841484

1485-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
1485+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
14861486
#ifndef __cpp_lib_ranges_iota
14871487
#error __cpp_lib_ranges_iota is not defined
14881488
#elif __cpp_lib_ranges_iota != 202202L
@@ -1496,7 +1496,7 @@ STATIC_ASSERT(__cpp_lib_ranges_iota == 202202L);
14961496
#endif
14971497
#endif
14981498

1499-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1499+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
15001500
#ifndef __cpp_lib_ranges_join_with
15011501
#error __cpp_lib_ranges_join_with is not defined
15021502
#elif __cpp_lib_ranges_join_with != 202202L
@@ -1510,7 +1510,7 @@ STATIC_ASSERT(__cpp_lib_ranges_join_with == 202202L);
15101510
#endif
15111511
#endif
15121512

1513-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1513+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
15141514
#ifndef __cpp_lib_ranges_slide
15151515
#error __cpp_lib_ranges_slide is not defined
15161516
#elif __cpp_lib_ranges_slide != 202202L
@@ -1524,7 +1524,7 @@ STATIC_ASSERT(__cpp_lib_ranges_slide == 202202L);
15241524
#endif
15251525
#endif
15261526

1527-
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
1527+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
15281528
#ifndef __cpp_lib_ranges_starts_ends_with
15291529
#error __cpp_lib_ranges_starts_ends_with is not defined
15301530
#elif __cpp_lib_ranges_starts_ends_with != 202106L
@@ -1676,7 +1676,7 @@ STATIC_ASSERT(__cpp_lib_shared_timed_mutex == 201402L);
16761676
#endif
16771677
#endif
16781678

1679-
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
1679+
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
16801680
#ifndef __cpp_lib_shift
16811681
#error __cpp_lib_shift is not defined
16821682
#elif __cpp_lib_shift != 202202L

0 commit comments

Comments
 (0)