Skip to content

GetCachedSize and SetCachedSize marked 'override', but does not override #2785

Description

@xinhua5

Describe the bug (描述bug)
In file included from ./src/brpc/baidu_master_service.h:28,
from ./src/brpc/server.h:46,
from src/brpc/global.cpp:92:
./src/brpc/serialized_response.h:56:9: error: 'int brpc::SerializedResponse::GetCachedSize() const' marked 'override', but does not override
56 | int GetCachedSize() const override { return (int)_serialized.size(); }
| ^~~~~~~~~~~~~
./src/brpc/serialized_response.h:74:10: error: 'void brpc::SerializedResponse::SetCachedSize(int) const' marked 'override', but does not override
74 | void SetCachedSize(int size) const override;
| ^~~~~~~~~~~~~
In file included from ./src/brpc/baidu_master_service.h:28,
from ./src/brpc/server.h:46,
from ./src/brpc/restful.h:24,
from src/brpc/restful.cpp:21:
./src/brpc/serialized_response.h:56:9: error: 'int brpc::SerializedResponse::GetCachedSize() const' marked 'override', but does not override
56 | int GetCachedSize() const override { return (int)_serialized.size(); }
| ^~~~~~~~~~~~~
./src/brpc/serialized_response.h:74:10: error: 'void brpc::SerializedResponse::SetCachedSize(int) const' marked 'override', but does not override
74 | void SetCachedSize(int size) const override;
| ^~~~~~~~~~~~~

To Reproduce (复现方法)
编译时复现,make -j

Expected behavior (期望行为)

Versions (各种版本)
OS: Linux wg-onekvopsgray-01 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Compiler: gcc (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
brpc: 1.10.0
protobuf: 3.25.5

Additional context/screenshots (更多上下文/截图)
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions