Skip to content

Commit

Permalink
Turn off static_asserts that cause ICE on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickroberts committed Feb 8, 2025
1 parent 722664f commit 04a3096
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/beman/any_view/constexpr.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@ constexpr auto sum(proxy_any_view<proxy_any_view<int>> views) {
}

TEST(ConstexprTest, sum_vector_of_vector) {
#ifndef _MSC_VER
// ICE on MSVC
static_assert(15 == sum(std::vector{std::vector{1, 2}, std::vector{3, 4}, std::vector{5}}));
#endif
EXPECT_EQ(15, sum(std::vector{std::vector{1, 2}, std::vector{3, 4}, std::vector{5}}));
}

TEST(ConstexprTest, sum_transform_view_of_iota) {
constexpr auto iota = [](int n) { return std::views::iota(1) | std::views::take(n); };
constexpr auto view = iota(5) | std::views::transform(iota);

#ifndef _MSC_VER
// ICE on MSVC
static_assert(35 == sum(view));
#endif
EXPECT_EQ(35, sum(view));
}

0 comments on commit 04a3096

Please sign in to comment.