From df6fa41e1b3b75513cce52e95fecc99b130f26c0 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Thu, 22 Aug 2024 21:19:18 +0300 Subject: [PATCH] Eliminate -Wreturn-type (at least on LCC) There are four GetName() functions that are expected to have a limited set of possible types. But compiler does not know about that, and may complain (and in LCC case, does) about no return operator in the end of these functions. This commit adds dummy return to each of these functions to eliminate this warning. --- googletest/test/googletest-output-test_.cc | 2 ++ googletest/test/gtest-typed-test_test.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index e3560c018..e30b69bbe 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 0cc8b2114..6b90ee4a0 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"); } };