Skip to content

Commit

Permalink
check test 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Werner Henze committed Jan 3, 2025
1 parent 904995f commit 4d82fd8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/span_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,17 @@ TEST(span_test, from_pointer_pointer_construction)
}

// this will fail the std::distance() precondition, which asserts on MSVC debug builds
{ // this test succeeds on all platforms, but it relies on UB
auto workaround_macro = [&]() { span<int> s{&arr[1], &arr[0]}; };
EXPECT_DEATH(workaround_macro(), expected);
}
//{ // this test succeeds on all platforms, but it relies on UB
// auto workaround_macro = [&]() { span<int> s{&arr[1], &arr[0]}; };
// EXPECT_DEATH(workaround_macro(), expected);
//}

// this will fail the std::distance() precondition, which asserts on MSVC debug builds
{
int* p = nullptr;
auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
EXPECT_DEATH(workaround_macro(), expected);
}
//{ // this test fails on gcc 13, clang 16, clang 17, xcode 15.4, vs 16
// int* p = nullptr;
// auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
// EXPECT_DEATH(workaround_macro(), expected);
//}

{
int* p = nullptr;
Expand All @@ -285,11 +285,11 @@ TEST(span_test, from_pointer_pointer_construction)
}

// this will fail the std::distance() precondition, which asserts on MSVC debug builds
//{
// int* p = nullptr;
// auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
// EXPECT_DEATH(workaround_macro(), expected);
//}
{
int* p = nullptr;
auto workaround_macro = [&]() { span<int> s{&arr[0], p}; };
EXPECT_DEATH(workaround_macro(), expected);
}
}

template <typename U, typename V, typename = void>
Expand Down

0 comments on commit 4d82fd8

Please sign in to comment.