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

            Bug ID: 83767
           Summary: -Wsuggest-override suggests to mark as override in
                    methods marked as final
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: albert.astals.cid at kdab dot com
  Target Milestone: ---

Created attachment 43088
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43088&action=edit
example code

I know that final does not always imply override but in the attached code it
does.

I think it would be great if -Wsuggest-override did not show a warning in this
case.

Code both here and attached.


struct A
{
    virtual void foo()
    {
    }
};

struct B : public A
{
    void foo() final
    {
    }
};

int main(int, char**)
{
    B b;
    return 0;
}

Reply via email to