Skip to content

Commit 62205ab

Browse files
authored
Workaround Intellisense bug in some ranges::to tests (#4895)
1 parent b191409 commit 62205ab

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

tests/std/tests/P1206R7_ranges_to_mappish/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ struct mappish_instantiator {
156156
assert(c5.get_allocator().state == 13);
157157
assert(ranges::is_permutation(c5, expected, any_pair_eq));
158158
}
159+
#ifndef __EDG__ // TRANSITION, VSO-2208356
159160
{
160161
std::same_as<T> auto c6 = R{some_pairs} | ranges::to<T>(Alloc{13});
161162
assert(c6.get_allocator().state == 13);
162163
assert(ranges::is_permutation(c6, expected, any_pair_eq));
163164
}
165+
#endif // ^^^ no workaround ^^^
164166
{
165167
std::same_as<T> auto c7 = R{some_pairs} | ranges::to<C>(Alloc{13});
166168
assert(c7.get_allocator().state == 13);

tests/std/tests/P1206R7_ranges_to_misc/test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ struct reservable {
5454
};
5555

5656
constexpr bool test_reservable() {
57+
#ifndef __EDG__ // TRANSITION, VSO-2208356
5758
int some_ints[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
5859
{
5960
std::same_as<reservable> auto r = some_ints | ranges::to<reservable>(secret_key);
6061
assert(r.size_ == ranges::size(some_ints));
6162
assert(r.cap_ == ranges::size(some_ints));
6263
assert(r.reserved_ == ranges::size(some_ints));
6364
}
65+
#endif // ^^^ no workaround ^^^
6466

6567
return true;
6668
}
@@ -91,12 +93,14 @@ constexpr bool test_common_constructible() {
9193
assert(c0.last_ == ranges::end(some_ints));
9294
assert(c0.args_ == 3);
9395
}
96+
#ifndef __EDG__ // TRANSITION, VSO-2208356
9497
{
9598
std::same_as<common_constructible> auto c1 = some_ints | ranges::to<common_constructible>(secret_key);
9699
assert(c1.first_ == ranges::begin(some_ints));
97100
assert(c1.last_ == ranges::end(some_ints));
98101
assert(c1.args_ == 3);
99102
}
103+
#endif // ^^^ no workaround ^^^
100104

101105
// Verify that more than one argument can be passed after the range:
102106
{
@@ -105,12 +109,14 @@ constexpr bool test_common_constructible() {
105109
assert(c2.last_ == ranges::end(some_ints));
106110
assert(c2.args_ == 4);
107111
}
112+
#ifndef __EDG__ // TRANSITION, VSO-2208356
108113
{
109114
std::same_as<common_constructible> auto c3 = some_ints | ranges::to<common_constructible>(secret_key, 3.14);
110115
assert(c3.first_ == ranges::begin(some_ints));
111116
assert(c3.last_ == ranges::end(some_ints));
112117
assert(c3.args_ == 4);
113118
}
119+
#endif // ^^^ no workaround ^^^
114120

115121
return true;
116122
}
@@ -296,6 +302,7 @@ constexpr void test_lwg4016_per_kind() {
296302
std::same_as<V> auto vec = std::views::iota(0, 42) | ranges::to<V>();
297303
assert(ranges::equal(vec, std::views::iota(0, 42)));
298304
}
305+
#ifndef __EDG__ // TRANSITION, VSO-2208356
299306
{
300307
std::same_as<V> auto vec = std::views::iota(0, 42) | ranges::to<V>(std::allocator<int>{});
301308
assert(ranges::equal(vec, std::views::iota(0, 42)));
@@ -308,6 +315,7 @@ constexpr void test_lwg4016_per_kind() {
308315
std::same_as<V> auto vec = std::views::empty<int> | ranges::to<V>(std::size_t{42}, std::allocator<int>{});
309316
assert(ranges::equal(vec, std::views::repeat(0, 42)));
310317
}
318+
#endif // ^^^ no workaround ^^^
311319
{
312320
std::same_as<V> auto vec = ranges::to<V>(std::views::iota(0, 42), std::initializer_list<int>{-3, -2, -1});
313321
assert(ranges::equal(vec, std::views::iota(-3, 42)));

tests/std/tests/P1206R7_ranges_to_sequence/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ struct sequence_instantiator {
145145
assert(c5.get_allocator().state == 13);
146146
assert(ranges::equal(c5, meow));
147147
}
148+
#ifndef __EDG__ // TRANSITION, VSO-2208356
148149
{
149150
std::same_as<T> auto c6 = R{meow} | ranges::to<T>(Alloc{13});
150151
assert(c6.get_allocator().state == 13);
151152
assert(ranges::equal(c6, meow));
152153
}
154+
#endif // ^^^ no workaround ^^^
153155
{
154156
std::same_as<T> auto c7 = R{meow} | ranges::to<C>(Alloc{13});
155157
assert(c7.get_allocator().state == 13);

tests/std/tests/P1206R7_ranges_to_settish/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ struct settish_instantiator {
150150
assert(c5.get_allocator().state == 13);
151151
assert(ranges::is_permutation(c5, expected));
152152
}
153+
#ifndef __EDG__ // TRANSITION, VSO-2208356
153154
{
154155
std::same_as<T> auto c6 = R{some_ints} | ranges::to<T>(Alloc{13});
155156
assert(c6.get_allocator().state == 13);
156157
assert(ranges::is_permutation(c6, expected));
157158
}
159+
#endif // ^^^ no workaround ^^^
158160
{
159161
std::same_as<T> auto c7 = R{some_ints} | ranges::to<C>(Alloc{13});
160162
assert(c7.get_allocator().state == 13);

0 commit comments

Comments
 (0)