loplugin:unnecessaryoverride look for more patterns

like
   bool Foo::bar() {
       b = Super::bar();
       return b;
   }

Change-Id: I5e4c8005a3da7d7487c9039c35dcbb1d17e65bd7
Reviewed-on: https://gerrit.libreoffice.org/68418
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-02-27 08:49:39 +02:00
parent 4ca1789e57
commit 48dc1e48d0
20 changed files with 115 additions and 156 deletions

View File

@@ -177,4 +177,17 @@ struct Derived5 : public Base5_1, public Base5_2
void f1() { Base5_1::f1(); } // no warning expected
};
struct Base6_1
{
bool f1();
};
struct Derived6 : public Base6_1
{
bool
f1() // expected-error {{public function just calls public parent [loplugin:unnecessaryoverride]}}
{
bool ret = Base6_1::f1();
return ret;
}
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */