Skip to content

Fix CallbackService forward declaration scope with --grpc-callback-api#9139

Open
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:fix/grpc-callback-api-9130
Open

Fix CallbackService forward declaration scope with --grpc-callback-api#9139
KirtiRamchandani wants to merge 1 commit into
google:masterfrom
KirtiRamchandani:fix/grpc-callback-api-9130

Conversation

@KirtiRamchandani

Copy link
Copy Markdown

Summary

When --grpc-callback-api is used, flatc emitted the CallbackService forward declaration inside StubInterface instead of in the enclosing service class. The out-of-class CallbackService definition uses Service::CallbackService, so the forward declaration must be at the service scope.

Fix

Move the class CallbackService; forward declaration to after the StubInterface closing brace, so it is declared as MonsterStorage::CallbackService rather than MonsterStorage::StubInterface::CallbackService.

Testing

  • Rebuilt flatc and regenerated tests/monster_test.grpc.fb.h golden file
  • Existing compile test grpc/tests/grpctest_callback_compile.cpp validates MonsterStorage::CallbackService usage (requires gRPC to run locally)

Fixes #9130

Move the CallbackService forward declaration out of StubInterface so it
is declared in the enclosing service class scope. The out-of-class
CallbackService definition expects MonsterStorage::CallbackService, not
MonsterStorage::StubInterface::CallbackService.

Fixes google#9130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flatc generates invalid C++ code with --grpc-callback-api

1 participant