浏览代码

Merge pull request #180 from ned14/master

Fix illegal C++ use of reinterpret_cast<> to cast between nullptr_t and a pointer
Feng Xiao 10 年之前
父节点
当前提交
76cb776d94
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/google/protobuf/compiler/cpp/cpp_service.cc

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_service.cc

@@ -301,7 +301,7 @@ void ServiceGenerator::GenerateGetPrototype(RequestOrResponse which,
   printer->Print(vars_,
   printer->Print(vars_,
     "    default:\n"
     "    default:\n"
     "      GOOGLE_LOG(FATAL) << \"Bad method index; this should never happen.\";\n"
     "      GOOGLE_LOG(FATAL) << \"Bad method index; this should never happen.\";\n"
-    "      return *reinterpret_cast< ::google::protobuf::Message*>(NULL);\n"
+    "      return *static_cast< ::google::protobuf::Message*>(NULL);\n"
     "  }\n"
     "  }\n"
     "}\n"
     "}\n"
     "\n");
     "\n");