From a897843f6c5495f8e90aaaed82884ee0dc29ef7e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 11 May 2017 00:36:31 +0100 Subject: [PATCH] Try to work around an MSVC bug Although, perhaps I shouldn't be generating over 1000 runs for a test. --- test/helpers/test.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/helpers/test.hpp b/test/helpers/test.hpp index 4b94ef5d..eaaa83f1 100644 --- a/test/helpers/test.hpp +++ b/test/helpers/test.hpp @@ -190,12 +190,16 @@ static inline state& get_state() BOOST_PP_SEQ_ELEM(1, product), \ BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(product))) +// Need to wrap UNORDERED_SUB_TEST in a block to avoid an msvc bug. +// https://support.microsoft.com/en-gb/help/315481/bug-too-many-unnested-loops-incorrectly-causes-a-c1061-compiler-error-in-visual-c #define UNORDERED_MULTI_TEST_OP2(name, n, params) \ - UNORDERED_SUB_TEST(BOOST_PP_STRINGIZE( \ - BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params))) \ { \ - for (int i = 0; i < n; ++i) \ - name BOOST_PP_SEQ_TO_TUPLE(params); \ + UNORDERED_SUB_TEST(BOOST_PP_STRINGIZE( \ + BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params))) \ + { \ + for (int i = 0; i < n; ++i) \ + name BOOST_PP_SEQ_TO_TUPLE(params); \ + } \ } #endif