diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 6a26b6d..2be3cbb 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -15,12 +15,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") target_compile_options( tts_test INTERFACE /W3 /EHsc ) else() - target_compile_options( tts_test INTERFACE -Werror -Wall -Wextra -Wunused-variable -Wdocumentation) + target_compile_options( tts_test INTERFACE -Werror -Wall -Wshadow -Wextra -Wunused-variable -Wdocumentation) endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options( tts_test INTERFACE /W3 /EHsc /Zc:preprocessor) else() - target_compile_options( tts_test INTERFACE -Werror -Wall -Wextra -Wunused-variable) + target_compile_options( tts_test INTERFACE -Werror -Wall -Wshadow -Wextra -Wunused-variable) endif() target_include_directories( tts_test INTERFACE diff --git a/include/tts/test/basic.hpp b/include/tts/test/basic.hpp index 2acaeb5..d4f2619 100644 --- a/include/tts/test/basic.hpp +++ b/include/tts/test/basic.hpp @@ -48,9 +48,9 @@ #define TTS_EXPECT_REQUIRED(EXPR) TTS_EXPECT_IMPL((EXPR),TTS_FATAL) #define TTS_EXPECT_IMPL(EXPR,FAILURE) \ -[&](auto&& expr) \ +[&](auto&& local_tts_expr) \ { \ - if( expr ) \ + if( local_tts_expr ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ @@ -97,9 +97,9 @@ #define TTS_EXPECT_NOT_REQUIRED(EXPR) TTS_EXPECT_NOT_IMPL(EXPR,TTS_FATAL) #define TTS_EXPECT_NOT_IMPL(EXPR,FAILURE) \ -[&](auto&& expr) \ +[&](auto&& local_tts_expr) \ { \ - if( !expr ) \ + if( !local_tts_expr ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ diff --git a/include/tts/test/precision.hpp b/include/tts/test/precision.hpp index 8307cbe..6b920ea 100644 --- a/include/tts/test/precision.hpp +++ b/include/tts/test/precision.hpp @@ -14,9 +14,9 @@ #include #define TTS_PRECISION_IMPL(LHS, RHS, N, UNIT, FUNC, PREC,FAILURE) \ -[&](auto lhs, auto rhs) \ +[&](auto local_tts_lhs, auto local_tts_rhs) \ { \ - auto r = FUNC (lhs,rhs); \ + auto r = FUNC (local_tts_lhs,local_tts_rhs); \ \ if(r <= N) \ { \ @@ -26,7 +26,8 @@ { \ FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ << " but " \ - << ::tts::as_string(lhs) << " == " << ::tts::as_string(rhs) \ + << ::tts::as_string(local_tts_lhs) \ + << " == " << ::tts::as_string(local_tts_rhs) \ << " within " << std::setprecision(PREC) << std::fixed \ << r << std::defaultfloat \ << " " << UNIT << " when " \ @@ -143,22 +144,22 @@ #define TTS_ULP_EQUAL(L,R,N,...) TTS_PRECISION(L,R,N,"ULP" , ::tts::ulp_distance , 2, __VA_ARGS__ ) -#define TTS_DO_IEEE_EQUAL_IMPL(LHS, RHS, FAILURE) \ -[&](auto lhs, auto rhs) \ -{ \ - if(::tts::is_ieee_equal(lhs,rhs)) \ - { \ - ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ - } \ - else \ - { \ - FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ - << " but " \ - << ::tts::as_string(lhs) << " != " << ::tts::as_string(rhs) \ - ); \ - return ::tts::detail::logger{}; \ - } \ -}(LHS,RHS) \ +#define TTS_DO_IEEE_EQUAL_IMPL(LHS, RHS, FAILURE) \ +[&](auto local_tts_lhs, auto local_tts_rhs) \ +{ \ + if(::tts::is_ieee_equal(local_tts_lhs,local_tts_rhs)) \ + { \ + ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ + } \ + else \ + { \ + FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ + << " but " \ + << ::tts::as_string(local_tts_lhs) << " != " << ::tts::as_string(local_tts_rhs) \ + ); \ + return ::tts::detail::logger{}; \ + } \ +}(LHS,RHS) \ /**/ #define TTS_DO_IEEE_EQUAL(L,R,...) TTS_DO_IEEE_EQUAL_ ## __VA_ARGS__ (L,R) diff --git a/include/tts/test/relation.hpp b/include/tts/test/relation.hpp index 5a86999..782056b 100644 --- a/include/tts/test/relation.hpp +++ b/include/tts/test/relation.hpp @@ -13,14 +13,15 @@ #include #define TTS_RELATION_BASE(A, B, OP, T, F, FAILURE) \ -if( ::tts::detail::OP(a,b) ) \ +if( ::tts::detail::OP(local_tts_a,local_tts_b) ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ else \ { \ FAILURE ( "Expression: " << TTS_STRING(A) << " " T " " << TTS_STRING(B) \ - << " is false because: " << ::tts::as_string(a) << " " F " " << ::tts::as_string(b) \ + << " is false because: " << ::tts::as_string(local_tts_a) \ + << " " F " " << ::tts::as_string(local_tts_b) \ ); \ return ::tts::detail::logger{}; \ } \ @@ -49,7 +50,7 @@ else #define TTS_RELATION_REQUIRED(A, B, OP, T, F) TTS_RELATION_IMPL(A,B,OP,T,F,TTS_FATAL) #define TTS_RELATION_IMPL(A, B, OP, T, F, FAILURE) \ -[&](auto&& a, auto&& b) \ +[&](auto&& local_tts_a, auto&& local_tts_b) \ { \ TTS_RELATION_BASE(A, B, OP, T, F, FAILURE) \ }(A,B) \ @@ -440,10 +441,10 @@ ::tts::detail::logger{::tts::global_logger_status} #define TTS_TYPED_RELATION_REQUIRED(A, B, OP, T, F) TTS_TYPED_RELATION_IMPL(A,B,OP,T,F,TTS_FATAL) #define TTS_TYPED_RELATION_IMPL(A, B, OP, T, F, FAILURE) \ -[&](auto&& a, auto&& b) \ +[&](auto&& local_tts_a, auto&& local_tts_b) \ { \ - using type_a = std::remove_cvref_t; \ - using type_b = std::remove_cvref_t; \ + using type_a = std::remove_cvref_t; \ + using type_b = std::remove_cvref_t; \ \ if ( !tts::same_as ) \ { \ diff --git a/include/tts/test/sequence.hpp b/include/tts/test/sequence.hpp index 5500f9e..8d80e0b 100644 --- a/include/tts/test/sequence.hpp +++ b/include/tts/test/sequence.hpp @@ -25,21 +25,21 @@ namespace tts::detail } #define TTS_ALL_IMPL(SEQ1,SEQ2,OP,N,UNIT,FAILURE) \ -[](auto const& a, auto const& b) \ +[](auto const& local_tts_a, auto const& local_tts_b) \ { \ - if( std::size(b) != std::size(a) ) \ + if( std::size(local_tts_b) != std::size(local_tts_a) ) \ { \ FAILURE ( "Expected: " << TTS_STRING(SEQ1) << " == " << TTS_STRING(SEQ2) \ << " but sizes does not match: " \ - << "size(" TTS_STRING(SEQ1) ") = " << std::size(a) \ - << " while size(" TTS_STRING(SEQ2) ") = " << std::size(b) \ + << "size(" TTS_STRING(SEQ1) ") = " << std::size(local_tts_a) \ + << " while size(" TTS_STRING(SEQ2) ") = " << std::size(local_tts_b) \ ); \ return ::tts::detail::logger{}; \ } \ \ - auto ba = std::begin(a); \ - auto bb = std::begin(b); \ - auto ea = std::end(a); \ + auto ba = std::begin(local_tts_a); \ + auto bb = std::begin(local_tts_b); \ + auto ea = std::end(local_tts_a); \ \ std::vector < ::tts::detail::failure< std::remove_cvref_t \ , std::remove_cvref_t \ diff --git a/include/tts/test/types.hpp b/include/tts/test/types.hpp index bcddc2d..ab2a44a 100644 --- a/include/tts/test/types.hpp +++ b/include/tts/test/types.hpp @@ -107,6 +107,8 @@ /**/ #define TTS_EXPECT_COMPILES_IMPL(EXPR, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ [&]( TTS_ARG(__VA_ARGS__) ) \ { \ if constexpr( requires TTS_REMOVE_PARENS(EXPR) ) \ @@ -120,6 +122,7 @@ ); \ return ::tts::detail::logger{}; \ } \ +TTS_DISABLE_WARNING_POP \ }(__VA_ARGS__) \ /**/ @@ -154,6 +157,8 @@ #endif #define TTS_EXPECT_NOT_COMPILES_IMPL(EXPR, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ [&]( TTS_ARG(__VA_ARGS__) ) \ { \ if constexpr( !(requires TTS_REMOVE_PARENS(EXPR)) ) \ @@ -165,6 +170,7 @@ TTS_FAIL("Expression: " << TTS_STRING(TTS_REMOVE_PARENS(EXPR)) << " compiles unexpectedly." ); \ return ::tts::detail::logger{}; \ } \ +TTS_DISABLE_WARNING_POP \ }(__VA_ARGS__) \ /**/ diff --git a/include/tts/test/when.hpp b/include/tts/test/when.hpp index 1be3d7c..9f34923 100644 --- a/include/tts/test/when.hpp +++ b/include/tts/test/when.hpp @@ -78,13 +78,18 @@ namespace tts::detail **/ //====================================================================================================================== #define TTS_WHEN(STORY) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ std::cout << "[^] - For: " << ::tts::detail::current_test << "\n"; \ std::cout << "When : " << STORY << std::endl; \ for(int tts_section = 0, tts_count = 1; tts_section < tts_count; tts_count -= 0==tts_section++) \ for( tts::detail::only_once tts_only_once_setup{}; tts_only_once_setup; ) \ +TTS_DISABLE_WARNING_POP \ /**/ #define TTS_AND_THEN_IMPL(TTS_LOCAL_ID, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ static int TTS_LOCAL_ID = 0; \ std::ostringstream TTS_CAT(desc_,TTS_LOCAL_ID); \ if(::tts::detail::section_guard(TTS_LOCAL_ID, tts_section, tts_count ) \ @@ -94,6 +99,7 @@ namespace tts::detail ) \ for(int tts_section = 0, tts_count = 1; tts_section < tts_count; tts_count -= 0==tts_section++ ) \ for(tts::detail::only_once tts__only_once_section{}; tts__only_once_section; ) \ +TTS_DISABLE_WARNING_POP \ /**/ //====================================================================================================================== diff --git a/include/tts/tools/preprocessor.hpp b/include/tts/tools/preprocessor.hpp index 6695237..195cd5d 100644 --- a/include/tts/tools/preprocessor.hpp +++ b/include/tts/tools/preprocessor.hpp @@ -7,6 +7,27 @@ //====================================================================================================================== #pragma once +//====================================================================================================================== +// Portable PRAGMA Handler +//====================================================================================================================== +#if defined(_MSC_VER) + #define TTS_DISABLE_WARNING_PUSH __pragma(warning( push )) + #define TTS_DISABLE_WARNING_POP __pragma(warning( pop )) + #define TTS_DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber )) + #define TTS_DISABLE_WARNING_SHADOW + +#elif defined(__GNUC__) || defined(__clang__) + #define TTS_DO_PRAGMA(X) _Pragma(#X) + #define TTS_DISABLE_WARNING_PUSH TTS_DO_PRAGMA(GCC diagnostic push) + #define TTS_DISABLE_WARNING_POP TTS_DO_PRAGMA(GCC diagnostic pop) + #define TTS_DISABLE_WARNING(warningName) TTS_DO_PRAGMA(GCC diagnostic ignored #warningName) + #define TTS_DISABLE_WARNING_SHADOW TTS_DISABLE_WARNING(-Wshadow) +#else + #define TTS_DISABLE_WARNING_PUSH + #define TTS_DISABLE_WARNING_POP + #define TTS_DISABLE_WARNING_SHADOW +#endif + //====================================================================================================================== // Macro chains for proper unique line based ID generation //====================================================================================================================== diff --git a/standalone/tts/tts.hpp b/standalone/tts/tts.hpp index 11c5a41..32c6dfb 100644 --- a/standalone/tts/tts.hpp +++ b/standalone/tts/tts.hpp @@ -345,6 +345,22 @@ namespace tts::detail template concept streamable = requires(T e, std::ostream& o) { o << e; }; } +#if defined(_MSC_VER) + #define TTS_DISABLE_WARNING_PUSH __pragma(warning( push )) + #define TTS_DISABLE_WARNING_POP __pragma(warning( pop )) + #define TTS_DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber )) + #define TTS_DISABLE_WARNING_SHADOW +#elif defined(__GNUC__) || defined(__clang__) + #define TTS_DO_PRAGMA(X) _Pragma(#X) + #define TTS_DISABLE_WARNING_PUSH TTS_DO_PRAGMA(GCC diagnostic push) + #define TTS_DISABLE_WARNING_POP TTS_DO_PRAGMA(GCC diagnostic pop) + #define TTS_DISABLE_WARNING(warningName) TTS_DO_PRAGMA(GCC diagnostic ignored #warningName) + #define TTS_DISABLE_WARNING_SHADOW TTS_DISABLE_WARNING(-Wshadow) +#else + #define TTS_DISABLE_WARNING_PUSH + #define TTS_DISABLE_WARNING_POP + #define TTS_DISABLE_WARNING_SHADOW +#endif #ifndef TTS_FUNCTION #define TTS_FUNCTION TTS_UNIQUE(tts_function) #endif @@ -606,9 +622,9 @@ namespace tts #define TTS_EXPECT_(EXPR) TTS_EXPECT_IMPL((EXPR),TTS_FAIL) #define TTS_EXPECT_REQUIRED(EXPR) TTS_EXPECT_IMPL((EXPR),TTS_FATAL) #define TTS_EXPECT_IMPL(EXPR,FAILURE) \ -[&](auto&& expr) \ +[&](auto&& local_tts_expr) \ { \ - if( expr ) \ + if( local_tts_expr ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ @@ -623,9 +639,9 @@ namespace tts #define TTS_EXPECT_NOT_(EXPR) TTS_EXPECT_NOT_IMPL(EXPR,TTS_FAIL) #define TTS_EXPECT_NOT_REQUIRED(EXPR) TTS_EXPECT_NOT_IMPL(EXPR,TTS_FATAL) #define TTS_EXPECT_NOT_IMPL(EXPR,FAILURE) \ -[&](auto&& expr) \ +[&](auto&& local_tts_expr) \ { \ - if( !expr ) \ + if( !local_tts_expr ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ @@ -1061,14 +1077,15 @@ namespace tts } } #define TTS_RELATION_BASE(A, B, OP, T, F, FAILURE) \ -if( ::tts::detail::OP(a,b) ) \ +if( ::tts::detail::OP(local_tts_a,local_tts_b) ) \ { \ ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ } \ else \ { \ FAILURE ( "Expression: " << TTS_STRING(A) << " " T " " << TTS_STRING(B) \ - << " is false because: " << ::tts::as_string(a) << " " F " " << ::tts::as_string(b) \ + << " is false because: " << ::tts::as_string(local_tts_a) \ + << " " F " " << ::tts::as_string(local_tts_b) \ ); \ return ::tts::detail::logger{}; \ } \ @@ -1094,7 +1111,7 @@ else #define TTS_RELATION_(A, B, OP, T, F) TTS_RELATION_IMPL(A,B,OP,T,F,TTS_FAIL) #define TTS_RELATION_REQUIRED(A, B, OP, T, F) TTS_RELATION_IMPL(A,B,OP,T,F,TTS_FATAL) #define TTS_RELATION_IMPL(A, B, OP, T, F, FAILURE) \ -[&](auto&& a, auto&& b) \ +[&](auto&& local_tts_a, auto&& local_tts_b) \ { \ TTS_RELATION_BASE(A, B, OP, T, F, FAILURE) \ }(A,B) \ @@ -1126,10 +1143,10 @@ ::tts::detail::logger{::tts::global_logger_status} #define TTS_TYPED_RELATION_(A, B, OP, T, F) TTS_TYPED_RELATION_IMPL(A,B,OP,T,F,TTS_FAIL) #define TTS_TYPED_RELATION_REQUIRED(A, B, OP, T, F) TTS_TYPED_RELATION_IMPL(A,B,OP,T,F,TTS_FATAL) #define TTS_TYPED_RELATION_IMPL(A, B, OP, T, F, FAILURE) \ -[&](auto&& a, auto&& b) \ +[&](auto&& local_tts_a, auto&& local_tts_b) \ { \ - using type_a = std::remove_cvref_t; \ - using type_b = std::remove_cvref_t; \ + using type_a = std::remove_cvref_t; \ + using type_b = std::remove_cvref_t; \ \ if ( !tts::same_as ) \ { \ @@ -1222,6 +1239,8 @@ do }(::tts::type{}, ::tts::type{}) \ #define TTS_EXPECT_COMPILES_IMPL(EXPR, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ [&]( TTS_ARG(__VA_ARGS__) ) \ { \ if constexpr( requires TTS_REMOVE_PARENS(EXPR) ) \ @@ -1235,6 +1254,7 @@ do ); \ return ::tts::detail::logger{}; \ } \ +TTS_DISABLE_WARNING_POP \ }(__VA_ARGS__) \ #if defined(TTS_DOXYGEN_INVOKED) @@ -1243,6 +1263,8 @@ do #define TTS_EXPECT_COMPILES(...) TTS_VAL(TTS_EXPECT_COMPILES_IMPL TTS_REVERSE(__VA_ARGS__) ) #endif #define TTS_EXPECT_NOT_COMPILES_IMPL(EXPR, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ [&]( TTS_ARG(__VA_ARGS__) ) \ { \ if constexpr( !(requires TTS_REMOVE_PARENS(EXPR)) ) \ @@ -1254,6 +1276,7 @@ do TTS_FAIL("Expression: " << TTS_STRING(TTS_REMOVE_PARENS(EXPR)) << " compiles unexpectedly." ); \ return ::tts::detail::logger{}; \ } \ +TTS_DISABLE_WARNING_POP \ }(__VA_ARGS__) \ #if defined(TTS_DOXYGEN_INVOKED) @@ -1477,9 +1500,9 @@ namespace detail } } #define TTS_PRECISION_IMPL(LHS, RHS, N, UNIT, FUNC, PREC,FAILURE) \ -[&](auto lhs, auto rhs) \ +[&](auto local_tts_lhs, auto local_tts_rhs) \ { \ - auto r = FUNC (lhs,rhs); \ + auto r = FUNC (local_tts_lhs,local_tts_rhs); \ \ if(r <= N) \ { \ @@ -1489,7 +1512,8 @@ namespace detail { \ FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ << " but " \ - << ::tts::as_string(lhs) << " == " << ::tts::as_string(rhs) \ + << ::tts::as_string(local_tts_lhs) \ + << " == " << ::tts::as_string(local_tts_rhs) \ << " within " << std::setprecision(PREC) << std::fixed \ << r << std::defaultfloat \ << " " << UNIT << " when " \ @@ -1507,22 +1531,22 @@ namespace detail #define TTS_ABSOLUTE_EQUAL(L,R,N,...) TTS_PRECISION(L,R,N,"unit", ::tts::absolute_distance, 8, __VA_ARGS__ ) #define TTS_RELATIVE_EQUAL(L,R,N,...) TTS_PRECISION(L,R,N,"%" , ::tts::relative_distance, 8, __VA_ARGS__ ) #define TTS_ULP_EQUAL(L,R,N,...) TTS_PRECISION(L,R,N,"ULP" , ::tts::ulp_distance , 2, __VA_ARGS__ ) -#define TTS_DO_IEEE_EQUAL_IMPL(LHS, RHS, FAILURE) \ -[&](auto lhs, auto rhs) \ -{ \ - if(::tts::is_ieee_equal(lhs,rhs)) \ - { \ - ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ - } \ - else \ - { \ - FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ - << " but " \ - << ::tts::as_string(lhs) << " != " << ::tts::as_string(rhs) \ - ); \ - return ::tts::detail::logger{}; \ - } \ -}(LHS,RHS) \ +#define TTS_DO_IEEE_EQUAL_IMPL(LHS, RHS, FAILURE) \ +[&](auto local_tts_lhs, auto local_tts_rhs) \ +{ \ + if(::tts::is_ieee_equal(local_tts_lhs,local_tts_rhs)) \ + { \ + ::tts::global_runtime.pass(); return ::tts::detail::logger{false}; \ + } \ + else \ + { \ + FAILURE ( "Expected: " << TTS_STRING(LHS) << " == " << TTS_STRING(RHS) \ + << " but " \ + << ::tts::as_string(local_tts_lhs) << " != " << ::tts::as_string(local_tts_rhs) \ + ); \ + return ::tts::detail::logger{}; \ + } \ +}(LHS,RHS) \ #define TTS_DO_IEEE_EQUAL(L,R,...) TTS_DO_IEEE_EQUAL_ ## __VA_ARGS__ (L,R) #define TTS_DO_IEEE_EQUAL_(L,R) TTS_DO_IEEE_EQUAL_IMPL(L,R,TTS_FAIL) @@ -1782,21 +1806,21 @@ namespace tts::detail }; } #define TTS_ALL_IMPL(SEQ1,SEQ2,OP,N,UNIT,FAILURE) \ -[](auto const& a, auto const& b) \ +[](auto const& local_tts_a, auto const& local_tts_b) \ { \ - if( std::size(b) != std::size(a) ) \ + if( std::size(local_tts_b) != std::size(local_tts_a) ) \ { \ FAILURE ( "Expected: " << TTS_STRING(SEQ1) << " == " << TTS_STRING(SEQ2) \ << " but sizes does not match: " \ - << "size(" TTS_STRING(SEQ1) ") = " << std::size(a) \ - << " while size(" TTS_STRING(SEQ2) ") = " << std::size(b) \ + << "size(" TTS_STRING(SEQ1) ") = " << std::size(local_tts_a) \ + << " while size(" TTS_STRING(SEQ2) ") = " << std::size(local_tts_b) \ ); \ return ::tts::detail::logger{}; \ } \ \ - auto ba = std::begin(a); \ - auto bb = std::begin(b); \ - auto ea = std::end(a); \ + auto ba = std::begin(local_tts_a); \ + auto bb = std::begin(local_tts_b); \ + auto ea = std::end(local_tts_a); \ \ std::vector < ::tts::detail::failure< std::remove_cvref_t \ , std::remove_cvref_t \ @@ -1861,12 +1885,17 @@ namespace tts::detail }; } #define TTS_WHEN(STORY) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ std::cout << "[^] - For: " << ::tts::detail::current_test << "\n"; \ std::cout << "When : " << STORY << std::endl; \ for(int tts_section = 0, tts_count = 1; tts_section < tts_count; tts_count -= 0==tts_section++) \ for( tts::detail::only_once tts_only_once_setup{}; tts_only_once_setup; ) \ +TTS_DISABLE_WARNING_POP \ #define TTS_AND_THEN_IMPL(TTS_LOCAL_ID, ...) \ +TTS_DISABLE_WARNING_PUSH \ +TTS_DISABLE_WARNING_SHADOW \ static int TTS_LOCAL_ID = 0; \ std::ostringstream TTS_CAT(desc_,TTS_LOCAL_ID); \ if(::tts::detail::section_guard(TTS_LOCAL_ID, tts_section, tts_count ) \ @@ -1876,5 +1905,6 @@ namespace tts::detail ) \ for(int tts_section = 0, tts_count = 1; tts_section < tts_count; tts_count -= 0==tts_section++ ) \ for(tts::detail::only_once tts__only_once_section{}; tts__only_once_section; ) \ +TTS_DISABLE_WARNING_POP \ #define TTS_AND_THEN(...) TTS_AND_THEN_IMPL(TTS_UNIQUE(id), __VA_ARGS__)