Removes unused code and lint warnings (#5773)

This commit is contained in:
Ankit Singh 2019-04-03 23:21:33 +05:30 committed by Adam Cozzette
parent 8e5b2f1b82
commit 1065652bf9

View File

@ -45,22 +45,7 @@ namespace cpp {
namespace {
// When we are generating code for implicit weak fields, we need to insert some
// additional casts. These functions return the casted expression if
// implicit_weak_field is true but otherwise return the original expression.
// Ordinarily a static_cast is enough to cast google::protobuf::MessageLite* to a class
// deriving from it, but we need a reinterpret_cast in cases where the generated
// message is forward-declared but its full definition is not visible.
string StaticCast(const std::string& type, const std::string& expression,
bool implicit_weak_field) {
if (implicit_weak_field) {
return "static_cast< " + type + " >(" + expression + ")";
} else {
return expression;
}
}
string ReinterpretCast(const std::string& type, const std::string& expression,
string ReinterpretCast(const string& type, const string& expression,
bool implicit_weak_field) {
if (implicit_weak_field) {
return "reinterpret_cast< " + type + " >(" + expression + ")";