Eliminate -Wreturn-type (at least on LCC)

There are four GetName<T>() functions that are expected to have
a limited set of possible <T> 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.
This commit is contained in:
makise-homura 2024-08-22 21:19:18 +03:00
parent 5b2ecaa64e
commit df6fa41e1b
2 changed files with 4 additions and 0 deletions

View File

@ -720,6 +720,7 @@ class TypedTestNames {
return std::string("char") + ::testing::PrintToString(i); return std::string("char") + ::testing::PrintToString(i);
if (std::is_same<T, int>::value) if (std::is_same<T, int>::value)
return std::string("int") + ::testing::PrintToString(i); return std::string("int") + ::testing::PrintToString(i);
return std::string("unknown");
} }
}; };
@ -755,6 +756,7 @@ class TypedTestPNames {
if (std::is_same<T, unsigned int>::value) { if (std::is_same<T, unsigned int>::value) {
return std::string("unsignedInt") + ::testing::PrintToString(i); return std::string("unsignedInt") + ::testing::PrintToString(i);
} }
return std::string("unknown");
} }
}; };

View File

@ -172,6 +172,7 @@ class TypedTestNames {
if (std::is_same<T, int>::value) { if (std::is_same<T, int>::value) {
return std::string("int") + ::testing::PrintToString(i); return std::string("int") + ::testing::PrintToString(i);
} }
return std::string("unknown");
} }
}; };
@ -320,6 +321,7 @@ class TypeParametrizedTestNames {
if (std::is_same<T, int>::value) { if (std::is_same<T, int>::value) {
return std::string("parInt") + ::testing::PrintToString(i); return std::string("parInt") + ::testing::PrintToString(i);
} }
return std::string("unknown");
} }
}; };