1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:17:44 +00:00

Everywhere: Fix -Winconsistent-missing-override warnings from Clang

This option is already enabled when building Lagom, so let's enable it
for the main build too. We will no longer be surprised by Lagom Clang
CI builds failing while everything compiles locally.

Furthermore, the stronger `-Wsuggest-override` warning is enabled in
this commit, which enforces the use of the `override` keyword in all
classes, not just those which already have some methods marked as
`override`. This works with both GCC and Clang.
This commit is contained in:
Daniel Bertalan 2021-12-04 10:09:09 +01:00 committed by Brian Gianforcaro
parent 813593a485
commit 4a81b33c07
22 changed files with 45 additions and 45 deletions

View file

@ -58,7 +58,7 @@ public:
static UCICommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
};
class DebugCommand : public Command {
@ -76,7 +76,7 @@ public:
static DebugCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
Flag flag() const { return m_flag; }
@ -93,7 +93,7 @@ public:
static IsReadyCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
};
class SetOptionCommand : public Command {
@ -107,7 +107,7 @@ public:
static SetOptionCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
const String& name() const { return m_name; }
const Optional<String>& value() const { return m_value; }
@ -128,7 +128,7 @@ public:
static PositionCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
const Optional<String>& fen() const { return m_fen; }
const Vector<Chess::Move>& moves() const { return m_moves; }
@ -147,7 +147,7 @@ public:
static GoCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
Optional<Vector<Chess::Move>> searchmoves;
bool ponder { false };
@ -172,7 +172,7 @@ public:
static StopCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
};
class IdCommand : public Command {
@ -191,7 +191,7 @@ public:
static IdCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
Type field_type() const { return m_field_type; }
const String& value() const { return m_value; }
@ -210,7 +210,7 @@ public:
static UCIOkCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
};
class ReadyOkCommand : public Command {
@ -222,7 +222,7 @@ public:
static ReadyOkCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
};
class BestMoveCommand : public Command {
@ -235,7 +235,7 @@ public:
static BestMoveCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
Chess::Move move() const { return m_move; }
@ -252,7 +252,7 @@ public:
static InfoCommand from_string(StringView command);
virtual String to_string() const;
virtual String to_string() const override;
Optional<int> depth;
Optional<int> seldepth;

View file

@ -27,8 +27,8 @@ public:
update(data);
}
void update(ReadonlyBytes data);
u32 digest();
virtual void update(ReadonlyBytes data) override;
virtual u32 digest() override;
private:
u32 m_state_a { 1 };

View file

@ -55,8 +55,8 @@ public:
update(data);
}
void update(ReadonlyBytes data);
u32 digest();
virtual void update(ReadonlyBytes data) override;
virtual u32 digest() override;
private:
u32 m_state { ~0u };

View file

@ -178,7 +178,7 @@ class MarkingVisitor final : public Cell::Visitor {
public:
MarkingVisitor() { }
virtual void visit_impl(Cell& cell)
virtual void visit_impl(Cell& cell) override
{
if (cell.is_marked())
return;

View file

@ -943,7 +943,7 @@ public:
bool has_selection() const { return !m_select_statement.is_null(); }
const RefPtr<Select>& select_statement() const { return m_select_statement; }
RefPtr<SQLResult> execute(ExecutionContext&) const;
virtual RefPtr<SQLResult> execute(ExecutionContext&) const override;
private:
RefPtr<CommonTableExpressionList> m_common_table_expression_list;

View file

@ -35,8 +35,8 @@ public:
const RefPtr<CSSStyleSheet> loaded_style_sheet() const { return m_style_sheet; }
void set_style_sheet(const RefPtr<CSSStyleSheet>& style_sheet) { m_style_sheet = style_sheet; }
virtual StringView class_name() const { return "CSSImportRule"; };
virtual Type type() const { return Type::Import; };
virtual StringView class_name() const override { return "CSSImportRule"; };
virtual Type type() const override { return Type::Import; };
private:
explicit CSSImportRule(AK::URL, DOM::Document&);

View file

@ -1345,7 +1345,7 @@ public:
return m_values[i];
}
virtual String to_string() const
virtual String to_string() const override
{
StringBuilder builder;
builder.appendff("List[{}](", m_values.size());

View file

@ -171,7 +171,7 @@ public:
const String& source() const { return m_source; }
void set_source(const String& source) { m_source = source; }
JS::Realm& realm();
virtual JS::Realm& realm() override;
JS::Interpreter& interpreter();
JS::Value run_javascript(StringView source, StringView filename = "(unknown)");

View file

@ -161,8 +161,8 @@ public:
void clear_overflow_data() { m_overflow_data = nullptr; }
virtual void before_children_paint(PaintContext&, PaintPhase);
virtual void after_children_paint(PaintContext&, PaintPhase);
virtual void before_children_paint(PaintContext&, PaintPhase) override;
virtual void after_children_paint(PaintContext&, PaintPhase) override;
protected:
Box(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)