diff --git a/CMakeLists.txt b/CMakeLists.txt index 512e5c3d48..56eab5dade 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.13) +cmake_policy(SET CMP0129 NEW) project(googletest-distribution) set(GOOGLETEST_VERSION 1.15.2) diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index 99b2411f36..c4d1a7506e 100644 --- a/googlemock/CMakeLists.txt +++ b/googlemock/CMakeLists.txt @@ -37,6 +37,7 @@ endif() # ${gmock_BINARY_DIR}. # Language "C" is required for find_package(Threads). cmake_minimum_required(VERSION 3.13) +cmake_policy(SET CMP0129 NEW) project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) if (COMMAND set_up_hermetic_build) diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index dce6a7c9ee..00009ec30a 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -47,6 +47,7 @@ endif() # Project version. cmake_minimum_required(VERSION 3.13) +cmake_policy(SET CMP0129 NEW) project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) if (COMMAND set_up_hermetic_build) diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 580ac1cbc3..9d8b79de05 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -102,9 +102,11 @@ macro(config_compiler_and_linker) if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") set(cxx_base_flags "${cxx_base_flags} -Wno-implicit-float-size-conversion -ffp-model=precise") endif() - elseif (CMAKE_COMPILER_IS_GNUCXX) - set(cxx_base_flags "-Wall -Wshadow -Wundef") - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR + CMAKE_CXX_COMPILER_ID STREQUAL "LCC") + set(cxx_base_flags "-Wall -Wundef") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0) set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else") endif() set(cxx_exception_flags "-fexceptions") @@ -115,6 +117,11 @@ macro(config_compiler_and_linker) set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0") set(cxx_strict_flags "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers") + if (CMAKE_CXX_COMPILER_ID STREQUAL "LCC") + set(cxx_base_flags "${cxx_base_flags} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function") + else() + set(cxx_base_flags "${cxx_base_flags} -Wshadow") + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") set(cxx_exception_flags "-features=except") # Sun Pro doesn't provide macros to indicate whether exceptions and diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 8d27c2c4f7..59ab39bfed 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -897,7 +897,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // Ask the compiler not to perform tail call optimization inside // the marked function. #define GTEST_NO_TAIL_CALL_ __attribute__((disable_tail_calls)) -#elif defined(__GNUC__) && !defined(__NVCOMPILER) +#elif defined(__GNUC__) && !defined(__EDG__) #define GTEST_NO_TAIL_CALL_ \ __attribute__((optimize("no-optimize-sibling-calls"))) #else diff --git a/googletest/test/googletest-list-tests-unittest.py b/googletest/test/googletest-list-tests-unittest.py index 977e57f087..2283eb91b8 100755 --- a/googletest/test/googletest-list-tests-unittest.py +++ b/googletest/test/googletest-list-tests-unittest.py @@ -74,7 +74,7 @@ TypedTest/1\. # TypeParam = int\s*\*( __ptr64)? TestA TestB -TypedTest/2\. # TypeParam = .*MyArray +TypedTest/2\. # TypeParam = .*MyArray TestA TestB My/TypeParamTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\. @@ -83,7 +83,7 @@ My/TypeParamTest/1\. # TypeParam = int\s*\*( __ptr64)? TestA TestB -My/TypeParamTest/2\. # TypeParam = .*MyArray +My/TypeParamTest/2\. # TypeParam = .*MyArray TestA TestB MyInstantiation/ValueParamTest\. diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index e3560c0182..e30b69bbec 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -720,6 +720,7 @@ class TypedTestNames { return std::string("char") + ::testing::PrintToString(i); if (std::is_same::value) return std::string("int") + ::testing::PrintToString(i); + return std::string("unknown"); } }; @@ -755,6 +756,7 @@ class TypedTestPNames { if (std::is_same::value) { return std::string("unsignedInt") + ::testing::PrintToString(i); } + return std::string("unknown"); } }; diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc index 0cc8b21145..6b90ee4a0b 100644 --- a/googletest/test/gtest-typed-test_test.cc +++ b/googletest/test/gtest-typed-test_test.cc @@ -172,6 +172,7 @@ class TypedTestNames { if (std::is_same::value) { return std::string("int") + ::testing::PrintToString(i); } + return std::string("unknown"); } }; @@ -320,6 +321,7 @@ class TypeParametrizedTestNames { if (std::is_same::value) { return std::string("parInt") + ::testing::PrintToString(i); } + return std::string("unknown"); } };