Browse Source

Removes unused code and lint warnings (#5773)

Ankit Singh 6 years ago
parent
commit
1065652bf9
1 changed files with 1 additions and 16 deletions
  1. 1 16
      src/google/protobuf/compiler/cpp/cpp_message_field.cc

+ 1 - 16
src/google/protobuf/compiler/cpp/cpp_message_field.cc

@@ -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 + ")";