[warnings] Add Wsuggest-override and Wsuggest-destructor-override.

This CL adds the `-Wsuggest-override` and
`-Wsuggest-destructor-override` warnings and fixes up the identified
issues.

Change-Id: I0ec1303a822abc258ce34d3bf1900e37ade6a8dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89561
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair 2022-05-10 18:44:34 +00:00 committed by Dawn LUCI CQ
parent 552045a559
commit a5ff0e9dc3
11 changed files with 12 additions and 10 deletions

2
DEPS
View File

@ -96,7 +96,7 @@ deps = {
'condition': 'dawn_standalone', 'condition': 'dawn_standalone',
}, },
'third_party/googletest': { 'third_party/googletest': {
'url': '{chromium_git}/external/github.com/google/googletest@6b74da4757a549563d7c37c8fae3e704662a043b', 'url': '{chromium_git}/external/github.com/google/googletest@bda85449f48f2d80a494c8c07766b6aba3170f3b',
'condition': 'dawn_standalone', 'condition': 'dawn_standalone',
}, },
# This is a dependency of //testing # This is a dependency of //testing

View File

@ -25,7 +25,7 @@ namespace dawn::wire::client {
class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider { class ClientBase : public ChunkedCommandHandler, public ObjectIdProvider {
public: public:
ClientBase() = default; ClientBase() = default;
virtual ~ClientBase() = default; ~ClientBase() override = default;
{% for type in by_category["object"] %} {% for type in by_category["object"] %}
const ObjectAllocator<{{type.name.CamelCase()}}>& {{type.name.CamelCase()}}Allocator() const { const ObjectAllocator<{{type.name.CamelCase()}}>& {{type.name.CamelCase()}}Allocator() const {

View File

@ -27,7 +27,7 @@ namespace dawn::wire::server {
class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver { class ServerBase : public ChunkedCommandHandler, public ObjectIdResolver {
public: public:
ServerBase() = default; ServerBase() = default;
virtual ~ServerBase() = default; ~ServerBase() override = default;
protected: protected:
void DestroyAllObjects(const DawnProcTable& procs) { void DestroyAllObjects(const DawnProcTable& procs) {

View File

@ -118,6 +118,8 @@ config("internal_config") {
"-Wredundant-move", "-Wredundant-move",
"-Wshadow-field", "-Wshadow-field",
"-Wstrict-prototypes", "-Wstrict-prototypes",
"-Wsuggest-destructor-override",
"-Wsuggest-override",
"-Wtautological-unsigned-zero-compare", "-Wtautological-unsigned-zero-compare",
"-Wunreachable-code-aggressive", "-Wunreachable-code-aggressive",
"-Wunused-but-set-variable", "-Wunused-but-set-variable",

View File

@ -48,7 +48,7 @@ class AsyncTaskManager {
class WaitableTask : public RefCounted { class WaitableTask : public RefCounted {
public: public:
WaitableTask(); WaitableTask();
~WaitableTask(); ~WaitableTask() override;
AsyncTask asyncTask; AsyncTask asyncTask;
AsyncTaskManager* taskManager; AsyncTaskManager* taskManager;

View File

@ -34,7 +34,7 @@ struct FlatComputePipelineDescriptor;
struct CreatePipelineAsyncCallbackTaskBase : CallbackTask { struct CreatePipelineAsyncCallbackTaskBase : CallbackTask {
CreatePipelineAsyncCallbackTaskBase(std::string errorMessage, void* userData); CreatePipelineAsyncCallbackTaskBase(std::string errorMessage, void* userData);
~CreatePipelineAsyncCallbackTaskBase(); ~CreatePipelineAsyncCallbackTaskBase() override;
protected: protected:
std::string mErrorMessage; std::string mErrorMessage;

View File

@ -60,7 +60,7 @@ using WGSLExtensionSet = std::unordered_set<std::string>;
class DeviceBase : public RefCounted { class DeviceBase : public RefCounted {
public: public:
DeviceBase(AdapterBase* adapter, const DeviceDescriptor* descriptor); DeviceBase(AdapterBase* adapter, const DeviceDescriptor* descriptor);
virtual ~DeviceBase(); ~DeviceBase() override;
void HandleError(InternalErrorType type, const char* message); void HandleError(InternalErrorType type, const char* message);

View File

@ -34,7 +34,7 @@ class D3D11on12ResourceCacheEntry : public RefCounted {
explicit D3D11on12ResourceCacheEntry(ComPtr<ID3D11On12Device> d3d11on12Device); explicit D3D11on12ResourceCacheEntry(ComPtr<ID3D11On12Device> d3d11on12Device);
D3D11on12ResourceCacheEntry(ComPtr<IDXGIKeyedMutex> d3d11on12Resource, D3D11on12ResourceCacheEntry(ComPtr<IDXGIKeyedMutex> d3d11on12Resource,
ComPtr<ID3D11On12Device> d3d11on12Device); ComPtr<ID3D11On12Device> d3d11on12Device);
~D3D11on12ResourceCacheEntry(); ~D3D11on12ResourceCacheEntry() override;
MaybeError AcquireKeyedMutex(); MaybeError AcquireKeyedMutex();
void ReleaseKeyedMutex(); void ReleaseKeyedMutex();

View File

@ -48,7 +48,7 @@ class CommandBuffer final : public CommandBufferBase {
const CommandBufferDescriptor* descriptor); const CommandBufferDescriptor* descriptor);
CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor); CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor);
~CommandBuffer(); ~CommandBuffer() override;
MaybeError FillCommands(CommandRecordingContext* commandContext); MaybeError FillCommands(CommandRecordingContext* commandContext);

View File

@ -89,7 +89,7 @@ BackendConnection* Connect(InstanceBase* instance) {
} }
struct CopyFromStagingToBufferOperation : PendingOperation { struct CopyFromStagingToBufferOperation : PendingOperation {
virtual void Execute() { void Execute() override {
destination->CopyFromStaging(staging, sourceOffset, destinationOffset, size); destination->CopyFromStaging(staging, sourceOffset, destinationOffset, size);
} }

View File

@ -22,7 +22,7 @@ using ::testing::HasSubstr;
class RequestDeviceValidationTest : public ValidationTest { class RequestDeviceValidationTest : public ValidationTest {
protected: protected:
void SetUp() { void SetUp() override {
DAWN_SKIP_TEST_IF(UsesWire()); DAWN_SKIP_TEST_IF(UsesWire());
ValidationTest::SetUp(); ValidationTest::SetUp();
} }