From 25e9631313ed354940eb59976df861c9ce102731 Mon Sep 17 00:00:00 2001 From: liqipeng Date: Tue, 10 Sep 2024 07:15:07 -0700 Subject: [PATCH] Fix cpp syntax error when the service method name is `request`. (#18174) Issue #18173 Closes #18174 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18174 from liqipeng:main_fix_bug_method_name_is_request 502a4cdd447815f11ab2d413c2bb1e6e586c8aa8 PiperOrigin-RevId: 672951448 --- src/google/protobuf/compiler/cpp/service.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/service.cc b/src/google/protobuf/compiler/cpp/service.cc index 4a2c0a233b..3c50fccfe4 100644 --- a/src/google/protobuf/compiler/cpp/service.cc +++ b/src/google/protobuf/compiler/cpp/service.cc @@ -256,8 +256,10 @@ void ServiceGenerator::GenerateCallMethodCases(io::Printer* printer) { }, R"cc( case $index$: - $name$(controller, ::$proto_ns$::DownCastMessage<$input$>(request), - ::$proto_ns$::DownCastMessage<$output$>(response), done); + this->$name$(controller, + ::$proto_ns$::DownCastMessage<$input$>(request), + ::$proto_ns$::DownCastMessage<$output$>(response), + done); break; )cc"); }