[Bug c++/78010] --Wsuggest-override reports a redundant warning on a 'final' method

2017-04-25 Thread ol.rakhimov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010

--- Comment #4 from ol.rakhimov at gmail dot com ---
(In reply to Arnaud Desitter from comment #3)
> Interesting reference. Note that "virtual + final" can be useful even if the
> core guidelines discourage its use.
> 
> struct A {
>   virtual void f() final;
> };
> struct B : A {
>// "void f()" cannot be defined
> };

I've seen this in Bjarne's C++11 FAQ/INFO pages,
but why would you do that? It's weird and uncommon.
Virtual implies functionality to be overridden.
If no override is permitted,
just use good-old plain member function.

struct A {
  void f();
};

struct B : A {
  void f();  // Comiler may warn about the hiding of A::f
};

[Bug c++/65856] -Wsuggest-override shall not report a warning on final method

2016-08-11 Thread ol.rakhimov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65856

ol.rakhimov at gmail dot com changed:

   What|Removed |Added

 CC||ol.rakhimov at gmail dot com

--- Comment #9 from ol.rakhimov at gmail dot com ---
Please reconsider this bug to get fixed.
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override

Clang doesn't throw warnings for using single ``final`` with
inconsistent-override warnings.