Skip to content

Commit

Permalink
Add testcase for #1100 (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrykobets-msft committed Mar 30, 2023
1 parent 43d60c5 commit 1d03658
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/span_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,3 +1380,16 @@ TEST(span_test, std_span)
EXPECT_TRUE(std_span.size() == gsl_span.size());
}
#endif // defined(FORCE_STD_SPAN_TESTS) || defined(__cpp_lib_span) && __cpp_lib_span >= 202002L

#if defined(__cpp_lib_span) && defined(__cpp_lib_ranges)
// This test covers the changes in PR #1100
TEST(span_test, msvc_compile_error_PR1100)
{
int arr[]{1, 7, 2, 9};
gsl::span sp{arr, std::size(arr)};
std::ranges::sort(sp);
for (const auto& e : sp) {
(void)e;
}
}
#endif // defined(__cpp_lib_span) && defined(__cpp_lib_ranges)

0 comments on commit 1d03658

Please sign in to comment.