From 5ce18c3f5a9e4ad6450ed265e80c3f4e345080ed Mon Sep 17 00:00:00 2001 From: Sreelakshmi Haridas Maruthur Date: Tue, 21 May 2024 09:47:47 -0600 Subject: [PATCH] basic: workaround MSVC compiler bug with post-increment operator (#1939) Prevent the compiler from optimizing away initialization loops --- test_conformance/basic/test_vector_swizzle.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test_conformance/basic/test_vector_swizzle.cpp b/test_conformance/basic/test_vector_swizzle.cpp index fdbc8919..6bdf651d 100644 --- a/test_conformance/basic/test_vector_swizzle.cpp +++ b/test_conformance/basic/test_vector_swizzle.cpp @@ -516,8 +516,7 @@ static void makeReference(std::vector& ref) // single channel lvalue for (size_t i = 0; i < N; i++) { - ref[dstIndex * S + i] = 0; - ++dstIndex; + ref[dstIndex++ * S + i] = 0; } // normal lvalue