Commit 1065652b authored by Ankit Singh's avatar Ankit Singh Committed by Adam Cozzette

Removes unused code and lint warnings (#5773)

parent 8e5b2f1b
......@@ -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 + ")";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment