Skip to content

Commit

Permalink
Code review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej committed Oct 30, 2021
1 parent f847e92 commit e88474f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
9 changes: 5 additions & 4 deletions tests/std/tests/P0896R4_ranges_alg_find_end/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ constexpr void smoke_test() {
}
}

constexpr void test_1559808() {
constexpr void test_devcom_1559808() {
// Regression test for DevCom-1559808, an interaction between vector and the
// use of structured bindings in the constexpr evaluator.

std::vector<int> haystack(33, 42), needle(8, 42); // No particular significance to any numbers in this function
std::vector<int> haystack(33, 42); // No particular significance to any numbers in this function
std::vector<int> needle(8, 42);
using size_type = std::vector<int>::size_type;

auto result = ranges::find_end(haystack, needle);
Expand All @@ -93,8 +94,8 @@ int main() {
STATIC_ASSERT((smoke_test(), true));
smoke_test();

STATIC_ASSERT((test_1559808(), true));
test_1559808();
STATIC_ASSERT((test_devcom_1559808(), true));
test_devcom_1559808();
}

#ifndef _PREFAST_ // TRANSITION, GH-1030
Expand Down
9 changes: 5 additions & 4 deletions tests/std/tests/P0896R4_ranges_alg_search/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ constexpr bool run_tests() {
return true;
}

constexpr void test_1559808() {
constexpr void test_devcom_1559808() {
// Regression test for DevCom-1559808, an interaction between vector and the
// use of structured bindings in the constexpr evaluator.

std::vector<int> haystack(33, 42), needle(8, 42); // No particular significance to any numbers in this function
vector<int> haystack(33, 42); // No particular significance to any numbers in this function
vector<int> needle(8, 42);

auto result = ranges::search(haystack, needle);
assert(result.begin() == haystack.begin());
Expand All @@ -189,7 +190,7 @@ int main() {
STATIC_ASSERT(run_tests());
run_tests();

STATIC_ASSERT((test_1559808(), true));
test_1559808();
STATIC_ASSERT((test_devcom_1559808(), true));
test_devcom_1559808();
}
#endif // TEST_EVERYTHING
6 changes: 3 additions & 3 deletions tests/std/tests/P0896R4_ranges_alg_sort/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct instantiator {
}
};

constexpr void test_1559808() {
constexpr void test_devcom_1559808() {
// Regression test for DevCom-1559808, a bad interaction between constexpr vector and the use of structured bindings
// in the implementation of ranges::sort.

Expand All @@ -65,6 +65,6 @@ int main() {
STATIC_ASSERT((test_random<instantiator, P>(), true));
test_random<instantiator, P>();

STATIC_ASSERT((test_1559808(), true));
test_1559808();
STATIC_ASSERT((test_devcom_1559808(), true));
test_devcom_1559808();
}
10 changes: 5 additions & 5 deletions tests/std/tests/P0896R4_views_split/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ constexpr bool instantiation_test() {
return true;
}

constexpr bool test_1559808() {
constexpr bool test_devcom_1559808() {
// Regression test for DevCom-1559808, an interaction between vector and the
// use of structured bindings in the constexpr evaluator.

Expand All @@ -345,8 +345,8 @@ int main() {
STATIC_ASSERT(instantiation_test());
instantiation_test();

#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevDiv-1516290
STATIC_ASSERT(test_1559808());
#endif // TRANSITION, DevDiv-1516290
test_1559808();
#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1516290
STATIC_ASSERT(test_devcom_1559808());
#endif // TRANSITION, DevCom-1516290
test_devcom_1559808();
}

0 comments on commit e88474f

Please sign in to comment.