https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65856

Alexander Volkov <a.volkov at rusbitech dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a.volkov at rusbitech dot ru

--- Comment #11 from Alexander Volkov <a.volkov at rusbitech dot ru> ---
Please, reopen.

Of course, it makes sense to suggest adding override in the following case:
struct A {
  virtual void f();
};
struct B : A {
  virtual void f() final override;
};

B::f() is specified as virtual, so if we remove A::f(), then B::f() will not
become a new virtual, but we'll get a compile error instead thanks to
'override' keyword.

But it is redundant in the following case:
struct A {
  virtual void f();
};
struct B : A {
  void f() final;
};

It is absolutely clear that B::f() overrides A::f(). If we remove A::f() or
change it's signature, then we'll get an error. There is no need to add
'override' here.

Reply via email to