Skip to content

Commit 73a6c0f

Browse files
committed
MSVC constexpr failure
call to immediate function is not a constant expression
1 parent 8a42e76 commit 73a6c0f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/beman/optional/optional_range_support.test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ TEST(RangeSupportTest, LoopOptionalAssignment) {
334334
constexpr_expect_eq(opt_int.value(), expected_value);
335335
return true;
336336
};
337+
#if !defined(_MSC_VER) // MSVC:call to immediate function is not a constant expression
337338
EXPECT_TRUE(constify(lambda()));
339+
#endif
338340
EXPECT_TRUE(lambda());
339341
}
340342

@@ -381,6 +383,7 @@ TEST(RangeSupportTest, PythagoreanTriples) {
381383
// Generate first 10 Pythagorean triples.
382384
// https://mathworld.wolfram.com/PythagoreanTriple.html
383385
auto&& r = triples | std::views::take(10);
386+
#if !defined(_MSC_VER) // MSVC:call to immediate function is not a constant expression
384387
CONSTEXPR_EXPECT_TRUE(std::ranges::equal(r,
385388
std::vector{
386389
std::tuple{3, 4, 5},
@@ -394,6 +397,7 @@ TEST(RangeSupportTest, PythagoreanTriples) {
394397
std::tuple{10, 24, 26},
395398
std::tuple{20, 21, 29},
396399
}));
400+
#endif
397401
}
398402

399403
if (!std::is_constant_evaluated()) { // too many steps for the default constant evaluation limit

0 commit comments

Comments
 (0)