Commit 5c56f228 by Jamie Madill Committed by Commit Bot

Enable two override suggestion warnings.

-Wsuggest-destructor-override and -Wsuggest-override. Bug: skia:7647 Change-Id: Iaac1baa8f34fdf210baf2fdbe811a582b3ac2d14 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2376717Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 34120d07
......@@ -151,6 +151,8 @@ config("extra_warnings") {
"-Wnon-virtual-dtor",
"-Wredundant-parens",
"-Wshadow-field",
"-Wsuggest-destructor-override",
"-Wsuggest-override",
"-Wtautological-type-limit-compare",
"-Wundefined-reinterpret-cast",
"-Wunneeded-internal-declaration",
......
......@@ -26,7 +26,7 @@ class SimpleLightingSample : public SampleApplication
: SampleApplication("SimpleLightingSample", argc, argv, 1, 0)
{}
virtual bool initialize()
bool initialize() override
{
glClearColor(0.4f, 0.3f, 0.2f, 1.0f);
mRotDeg = 0.0f;
......@@ -34,9 +34,9 @@ class SimpleLightingSample : public SampleApplication
return true;
}
virtual void destroy() {}
void destroy() override {}
virtual void draw()
void draw() override
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
......
......@@ -29,7 +29,7 @@ class MultipleDrawBuffersSample : public SampleApplication
: SampleApplication("MultipleDrawBuffers", argc, argv)
{}
virtual bool initialize()
bool initialize() override
{
// Check EXT_draw_buffers is supported
char *extensionString = (char *)glGetString(GL_EXTENSIONS);
......@@ -107,7 +107,7 @@ class MultipleDrawBuffersSample : public SampleApplication
return true;
}
virtual void destroy()
void destroy() override
{
glDeleteProgram(mCopyProgram);
glDeleteProgram(mMRTProgram);
......@@ -116,7 +116,7 @@ class MultipleDrawBuffersSample : public SampleApplication
glDeleteFramebuffers(1, &mFramebuffer);
}
virtual void draw()
void draw() override
{
GLfloat vertices[] = {
-0.8f, 0.8f, 0.0f, // Position 0
......
......@@ -360,6 +360,17 @@ std::ostream &FmtHex(std::ostream &os, T value)
#endif
#if defined(__clang__)
# define ANGLE_DISABLE_SUGGEST_OVERRIDE_WARNINGS \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wsuggest-destructor-override\"") \
_Pragma("clang diagnostic ignored \"-Wsuggest-override\"")
# define ANGLE_REENABLE_SUGGEST_OVERRIDE_WARNINGS _Pragma("clang diagnostic pop")
#else
# define ANGLE_DISABLE_SUGGEST_OVERRIDE_WARNINGS
# define ANGLE_REENABLE_SUGGEST_OVERRIDE_WARNINGS
#endif
#if defined(__clang__)
# define ANGLE_DISABLE_EXTRA_SEMI_WARNING \
_Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wextra-semi\"")
# define ANGLE_REENABLE_EXTRA_SEMI_WARNING _Pragma("clang diagnostic pop")
......
......@@ -262,7 +262,7 @@ class HashingMRUCache : public MRUCacheBase<KeyType, PayloadType, HashType, MRUC
public:
// See MRUCacheBase, noting the possibility of using NO_AUTO_EVICT.
explicit HashingMRUCache(typename ParentType::size_type max_size) : ParentType(max_size) {}
virtual ~HashingMRUCache() {}
virtual ~HashingMRUCache() override {}
private:
DISALLOW_COPY_AND_ASSIGN(HashingMRUCache);
......
......@@ -39,7 +39,7 @@ class AliasingBreaker : public TIntermTraverser
AliasingBreaker() : TIntermTraverser(true, false, true) {}
protected:
bool visitBinary(Visit visit, TIntermBinary *binary)
bool visitBinary(Visit visit, TIntermBinary *binary) override
{
if (visit != PreVisit)
{
......@@ -78,7 +78,7 @@ class AliasingBreaker : public TIntermTraverser
return true;
}
bool visitLoop(Visit visit, TIntermLoop *loop)
bool visitLoop(Visit visit, TIntermLoop *loop) override
{
if (visit == PreVisit)
{
......
......@@ -25,7 +25,7 @@ class SymbolFinder : public TIntermTraverser
: TIntermTraverser(true, false, false), mSymbolName(symbolName), mNodeFound(nullptr)
{}
void visitSymbol(TIntermSymbol *node)
void visitSymbol(TIntermSymbol *node) override
{
if (node->variable().symbolType() != SymbolType::Empty && node->getName() == mSymbolName)
{
......
......@@ -301,7 +301,7 @@ class TLValueTrackingTraverser : public TIntermTraverser
bool inVisit,
bool postVisit,
TSymbolTable *symbolTable);
virtual ~TLValueTrackingTraverser() {}
~TLValueTrackingTraverser() override {}
void traverseBinary(TIntermBinary *node) final;
void traverseUnary(TIntermUnary *node) final;
......
......@@ -36,7 +36,7 @@ class NodeSearchTraverser : public TIntermTraverser
class FindDiscard : public NodeSearchTraverser<FindDiscard>
{
public:
virtual bool visitBranch(Visit visit, TIntermBranch *node)
bool visitBranch(Visit visit, TIntermBranch *node) override
{
switch (node->getFlowOp())
{
......
......@@ -235,7 +235,7 @@ class SubjectBindingPointer : protected BindingPointer<SubjectT>, public angle::
SubjectBindingPointer(angle::ObserverInterface *observer, angle::SubjectIndex index)
: ObserverBindingBase(observer, index)
{}
~SubjectBindingPointer() {}
~SubjectBindingPointer() override {}
SubjectBindingPointer(const SubjectBindingPointer &other) = default;
SubjectBindingPointer &operator=(const SubjectBindingPointer &other) = default;
......
......@@ -11,6 +11,7 @@
// glslang has issues with some specific warnings.
ANGLE_DISABLE_EXTRA_SEMI_WARNING
ANGLE_DISABLE_SHADOWING_WARNING
ANGLE_DISABLE_SUGGEST_OVERRIDE_WARNINGS
// glslang's version of ShaderLang.h, not to be confused with ANGLE's.
#include <glslang/Public/ShaderLang.h>
......@@ -19,6 +20,7 @@ ANGLE_DISABLE_SHADOWING_WARNING
#include <SPIRV/GlslangToSpv.h>
#include <StandAlone/ResourceLimits.h>
ANGLE_REENABLE_SUGGEST_OVERRIDE_WARNINGS
ANGLE_REENABLE_SHADOWING_WARNING
ANGLE_REENABLE_EXTRA_SEMI_WARNING
......
......@@ -184,6 +184,8 @@ angle_source_set("angle_vk_mem_alloc_wrapper") {
cflags_cc = [
"-Wno-extra-semi-stmt",
"-Wno-missing-field-initializers",
"-Wno-suggest-destructor-override",
"-Wno-suggest-override",
]
}
}
......
......@@ -34,7 +34,7 @@ class SyncHelper : public vk::Resource
{
public:
SyncHelper();
virtual ~SyncHelper();
~SyncHelper() override;
virtual void releaseToRenderer(RendererVk *renderer);
......
......@@ -20,8 +20,6 @@
#include <lib/zx/channel.h>
#include <zircon/status.h>
#include "common/debug.h"
namespace
{
......
......@@ -16,6 +16,7 @@
// Disable ANGLE-specific warnings that pop up in fuchsia headers.
ANGLE_DISABLE_DESTRUCTOR_OVERRIDE_WARNING
ANGLE_DISABLE_SUGGEST_OVERRIDE_WARNINGS
#include <fuchsia/ui/policy/cpp/fidl.h>
#include <fuchsia/ui/scenic/cpp/fidl.h>
......@@ -27,6 +28,7 @@ ANGLE_DISABLE_DESTRUCTOR_OVERRIDE_WARNING
#include <zircon/types.h>
#include <string>
ANGLE_REENABLE_SUGGEST_OVERRIDE_WARNINGS
ANGLE_REENABLE_DESTRUCTOR_OVERRIDE_WARNING
struct FuchsiaEGLWindowDeleter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment