diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 89ca27b3..6512bbd4 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -4538,7 +4538,7 @@ class [[nodiscard]] ArgsMatcherImpl : public MatcherInterface { bool MatchAndExplain(ArgsTuple args, MatchResultListener* listener) const override { - // Workaround spurious C4100 on MSVC<=15.7 when k is empty. + // Workaround spurious GCC warning when k is empty. (void)args; const SelectedArgs& selected_args = std::forward_as_tuple(std::get(args)...); @@ -4571,7 +4571,7 @@ class [[nodiscard]] ArgsMatcherImpl : public MatcherInterface { static void PrintIndices(::std::ostream* os) { *os << "whose fields ("; const char* sep = ""; - // Workaround spurious C4189 on MSVC<=15.7 when k is empty. + // Workaround spurious GCC warning when k is empty. (void)sep; // The static_cast to void is needed to silence Clang's -Wcomma warning. // This pattern looks suspiciously like we may have mismatched parentheses diff --git a/googlemock/include/gmock/gmock-more-matchers.h b/googlemock/include/gmock/gmock-more-matchers.h index 9d9688ef..d0104cb3 100644 --- a/googlemock/include/gmock/gmock-more-matchers.h +++ b/googlemock/include/gmock/gmock-more-matchers.h @@ -50,11 +50,6 @@ namespace testing { // Silence C4100 (unreferenced formal // parameter) for MSVC GTEST_DISABLE_MSC_WARNINGS_PUSH_(4100) -#if defined(_MSC_VER) && (_MSC_VER == 1900) -// and silence C4800 (C4800: 'int *const ': forcing value -// to bool 'true' or 'false') for MSVC 14 -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800) -#endif namespace internal { @@ -123,9 +118,6 @@ MATCHER(IsFalse, negation ? "is true" : "is false") { return !static_cast(arg); } -#if defined(_MSC_VER) && (_MSC_VER == 1900) -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4800 -#endif GTEST_DISABLE_MSC_WARNINGS_POP_() // 4100 } // namespace testing diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index 88e0c020..e38161d1 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -56,12 +56,6 @@ #include #endif -// Silence C4800 (C4800: 'int *const ': forcing value -// to bool 'true' or 'false') for MSVC 15 -#if defined(_MSC_VER) && (_MSC_VER == 1900) -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800) -#endif - namespace testing { namespace internal { @@ -786,7 +780,3 @@ InSequence::~InSequence() { } } // namespace testing - -#if defined(_MSC_VER) && (_MSC_VER == 1900) -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4800 -#endif diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index 7630bfc9..86ee3095 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -53,11 +53,6 @@ // Silence C4100 (unreferenced formal parameter) and C4503 (decorated name // length exceeded) for MSVC. GTEST_DISABLE_MSC_WARNINGS_PUSH_(4100 4503) -#if defined(_MSC_VER) && (_MSC_VER == 1900) -// and silence C4800 (C4800: 'int *const ': forcing value -// to bool 'true' or 'false') for MSVC 15 -GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800) -#endif namespace testing { namespace { @@ -2217,7 +2212,4 @@ TEST(ActionMacro, LargeArity) { } // namespace } // namespace testing -#if defined(_MSC_VER) && (_MSC_VER == 1900) -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4800 -#endif GTEST_DISABLE_MSC_WARNINGS_POP_() // 4100 4503 diff --git a/googlemock/test/gmock-matchers-comparisons_test.cc b/googlemock/test/gmock-matchers-comparisons_test.cc index e90b3af7..b632ee29 100644 --- a/googlemock/test/gmock-matchers-comparisons_test.cc +++ b/googlemock/test/gmock-matchers-comparisons_test.cc @@ -1046,12 +1046,7 @@ struct MoveHelper { MOCK_METHOD1(Call, void(MoveOnly)); }; -// Disable this test in VS 2015 (version 14), where it fails when SEH is enabled -#if defined(_MSC_VER) && (_MSC_VER < 1910) -TEST(ComparisonBaseTest, DISABLED_WorksWithMoveOnly) { -#else TEST(ComparisonBaseTest, WorksWithMoveOnly) { -#endif MoveOnly m{0}; MoveHelper helper; diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index 64c0510c..60556d66 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -226,13 +226,10 @@ if (gtest_build_tests) ############################################################ # C++ tests built with non-standard compiler flags. - # MSVC 7.1 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) - cxx_library(gtest_no_exception "${cxx_no_exception}" - src/gtest-all.cc) - cxx_library(gtest_main_no_exception "${cxx_no_exception}" - src/gtest-all.cc src/gtest_main.cc) - endif() + cxx_library(gtest_no_exception "${cxx_no_exception}" + src/gtest-all.cc) + cxx_library(gtest_main_no_exception "${cxx_no_exception}" + src/gtest-all.cc src/gtest_main.cc) cxx_library(gtest_main_no_rtti "${cxx_no_rtti}" src/gtest-all.cc src/gtest_main.cc) @@ -264,14 +261,11 @@ if (gtest_build_tests) py_test(gtest_skip_check_output_test) py_test(gtest_skip_environment_check_output_test) - # Visual Studio .NET 2003 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003 - cxx_executable_with_flags( - googletest-catch-exceptions-no-ex-test_ - "${cxx_no_exception}" - gtest_main_no_exception - test/googletest-catch-exceptions-test_.cc) - endif() + cxx_executable_with_flags( + googletest-catch-exceptions-no-ex-test_ + "${cxx_no_exception}" + gtest_main_no_exception + test/googletest-catch-exceptions-test_.cc) cxx_executable_with_flags( googletest-catch-exceptions-ex-test_ @@ -301,14 +295,11 @@ if (gtest_build_tests) cxx_executable(googletest-shuffle-test_ test gtest) py_test(googletest-shuffle-test) - # MSVC 7.1 does not support STL with exceptions disabled. - if (NOT MSVC OR MSVC_VERSION GREATER 1310) - cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception) - set_target_properties(googletest-throw-on-failure-test_ - PROPERTIES - COMPILE_FLAGS "${cxx_no_exception}") - py_test(googletest-throw-on-failure-test) - endif() + cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception) + set_target_properties(googletest-throw-on-failure-test_ + PROPERTIES + COMPILE_FLAGS "${cxx_no_exception}") + py_test(googletest-throw-on-failure-test) cxx_executable(googletest-uninitialized-test_ test gtest) py_test(googletest-uninitialized-test) diff --git a/googletest/include/gtest/gtest-assertion-result.h b/googletest/include/gtest/gtest-assertion-result.h index a72ac939..d2b42a60 100644 --- a/googletest/include/gtest/gtest-assertion-result.h +++ b/googletest/include/gtest/gtest-assertion-result.h @@ -143,11 +143,9 @@ class GTEST_API_ [[nodiscard]] AssertionResult { // Used in EXPECT_TRUE/FALSE(assertion_result). AssertionResult(const AssertionResult& other); -// C4800 is a level 3 warning in Visual Studio 2015 and earlier. -// This warning is not emitted in Visual Studio 2017. -// This warning is off by default starting in Visual Studio 2019 but can be +// C4800 is off by default starting in Visual Studio 2019 but can be // enabled with command-line options. -#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920) +#if defined(_MSC_VER) && _MSC_VER >= 1920 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */) #endif @@ -171,7 +169,7 @@ class GTEST_API_ [[nodiscard]] AssertionResult { int> = 0> explicit AssertionResult(const T& success) : success_(success) {} -#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920) +#if defined(_MSC_VER) && _MSC_VER >= 1920 GTEST_DISABLE_MSC_WARNINGS_POP_() #endif