brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
Describe the bug (描述bug)
在Arch Linux上用g++或者clang++都无法通过编译,且报错不同。
g++:
brpc/src/brpc/baidu_master_service.h:91:24: error: cannot declare field ‘brpc::BaiduMasterService::_default_response’ to be of abstract type ‘brpc::SerializedResponse’
91 | SerializedResponse _default_response;
/brpc/serialized_response.h:29:7: note: because the following virtual functions are pure within ‘brpc::SerializedResponse’:
29 | class SerializedResponse : public ::google::protobuf::Message {
...
clang++
brpc/src/brpc/serialized_request.h:54:32: error: only virtual member functions can be marked 'override'
54 | bool IsInitialized() const override;
brpc/src/brpc/serialized_request.h:70:61: error: only virtual member functions can be marked 'override'
70 | void MergeFrom(const ::google::protobuf::Message& from) override
...
去除override之后为
./src/brpc/serialized_request.h:60:32: error: ‘google::protobuf::Metadata brpc::SerializedRequest::GetMetadata() const’ marked ‘override’, but does not override
60 | ::google::protobuf::Metadata GetMetadata() const override;
Describe the bug (描述bug) 在Arch Linux上用g++或者clang++都无法通过编译,且报错不同。
g++:
brpc/src/brpc/baidu_master_service.h:91:24: error: cannot declare field ‘brpc::BaiduMasterService::_default_response’ to be of abstract type ‘brpc::SerializedResponse’ 91 | SerializedResponse _default_response;
/brpc/serialized_response.h:29:7: note: because the following virtual functions are pure within ‘brpc::SerializedResponse’: 29 | class SerializedResponse : public ::google::protobuf::Message { ...
clang++
brpc/src/brpc/serialized_request.h:54:32: error: only virtual member functions can be marked 'override' 54 | bool IsInitialized() const override;
brpc/src/brpc/serialized_request.h:70:61: error: only virtual member functions can be marked 'override' 70 | void MergeFrom(const ::google::protobuf::Message& from) override ...
去除override之后为
./src/brpc/serialized_request.h:60:32: error: ‘google::protobuf::Metadata brpc::SerializedRequest::GetMetadata() const’ marked ‘override’, but does not override 60 | ::google::protobuf::Metadata GetMetadata() const override;
To Reproduce (复现方法)
按照 https://brpc.apache.org/docs/getting_started/ 网站上用config_brpc.sh的方法进行编译
Expected behavior (期望行为)
应当正常编译
Versions (各种版本) OS: Arch Linux Compiler: g++/clang++ brpc: master protobuf: 27.3-2 grpc: 1.65.5-1