From 0095302f2d8af7b0c43bdba8efd2ac87aefc5cd5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 30 Apr 2024 10:18:45 +0200 Subject: [PATCH] fix the test for buggy MSVC 2017 --- .../test/STL_Extension/test_fwd_make_array.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/STL_Extension/test/STL_Extension/test_fwd_make_array.cpp b/STL_Extension/test/STL_Extension/test_fwd_make_array.cpp index 6d55735a14f..dc1663b53a3 100644 --- a/STL_Extension/test/STL_Extension/test_fwd_make_array.cpp +++ b/STL_Extension/test/STL_Extension/test_fwd_make_array.cpp @@ -14,8 +14,17 @@ struct A // move-only class, move-constructible from B int main() { - // this test requires C++17 mandatory return-value optimization (RVO) +#if ! defined(_MSC_VER) || (_MSC_VER > 1916) + // This test requires C++17 mandatory return-value optimization (RVO). + // + // MSVC-2017 does not implement C++17 correctly + // See https://godbolt.org/z/7Y34Y1c53 + // and commit 15349f0bdafe60b85697f9d142c2652200d968e8 + // where we introduced a workaround for MSVC-2017: disable the correct + // forwarding of arguments in the `make_array` function. + // For that reason we disable this test for MSVC-2017) std::array a = CGAL::make_array(B()); +#endif auto b = CGAL::make_array(1u); static_assert(std::is_same_v>); CGAL_USE(a);