23 Commits

Author SHA1 Message Date
Stephan Bergmann
a11e0d428c loplugin:unnecessaryoverride: no warnings when fns are actually different
Change-Id: I90d8af7a1affa459400b1cae4805e3a80b6c5200
Reviewed-on: https://gerrit.libreoffice.org/44593
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-10 19:13:38 +01:00
Stephan Bergmann
2b88ea29a1 No need to blacklist this loplugin:unnecessaryoverride
...a using declaration should fix it just fine

Change-Id: I05cf76672bcceb7a94afa602e215a0b5a32de82b
Reviewed-on: https://gerrit.libreoffice.org/44591
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-10 19:12:25 +01:00
Stephan Bergmann
3d2dbf45eb No need to blacklist this loplugin:unnecessaryoverride
...a using declaration should fix it just fine

Change-Id: I0279994c155775e9a58e93aef8da4522d4fd93fd
Reviewed-on: https://gerrit.libreoffice.org/44590
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-10 19:11:41 +01:00
Stephan Bergmann
d4ee66c15e No need to check both (identical) param_size() and getNumParams()
Change-Id: I481cfa8b0f4bb9cbc257d28f36c372fb7367f294
2017-11-10 08:51:43 +01:00
Stephan Bergmann
9fbe22e1d9 No need to blacklist this loplugin:unnecessaryoverride
This now hides one of the ScVbaFormatCondition_BASE::Operator overloads, but
that doesn't get called directly at ScVbaFormatCondition anyway.  (And if it
were, we could add an appropriate using declaration to ScVbaFormatCondition.)

Change-Id: I8440b76a5745c6874f7a3bfcbb4bc4ce5618a4c4
2017-11-09 07:54:51 +01:00
Stephan Bergmann
a6309a3c4d Suppress loplugin:unnecessaryoverride...
...when a class derives from multiple (non-virtual) instances of one base class,
and the override disambiguates which of those instances' member to call.

That was the case with SwXTextDocument::queryAdapter
(sw/source/uibase/uno/unotxdoc.cxx), where SwXTextDocument derives from
cppu::OWeakObject through both SwXTextDocumentBaseClass and SfxBaseModel, but
calling queryAdapter through a pointer to SwXTextDocumentBaseClass apparently
needs to call OWeakObject::queryAdapter on the second, SfxBaseModel-inherited
OWeakObject base instance, or else CppunitTest_sw_macros_test fails.

Who knows what other instances of similar non-unnecessary overrides have been
removed with the help of broken loplugin:unnecessaryoverride, for which there
were no tests that started to fail...

Turns out .clang-format lacked "ReflowComments: false" to not break the special
"// expected-error {{...}}" etc. comments in compilerplugins/clang/test/.

Also, use a better location to report loplugin:unnecessaryoverride, to keep
clang-format and loplugin:unnecessaryoverride from fighting over how to split
lines and where to put the comment in
compilerplugins/clang/test/unnecessaryoverride.cxx.

Change-Id: I3b24df24369db12f8ec1080d6c9f7b70ff561a16
Reviewed-on: https://gerrit.libreoffice.org/44418
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-08 07:53:29 +01:00
Stephan Bergmann
b35bb38f18 Clean away temporarily added using declarations
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-11-07 11:50:47 +01:00
Stephan Bergmann
419d664fb7 Adapt loplugins to clang-cl's (implicit) -fdelayed-template-parsing
...which is there for MSVC compatibility, but can cause getBody() to return null
even when doesThisDeclarationHaveABody() is true.

And in staticmethods.cxx we need to check doesThisDeclarationHaveABody() instead
of hasBody():  For some class template member functions that are only defined
outside their class definition, as is the case for
OSequenceIterator::hasMoreElements in include/comphelper/sequence.hxx, hasBody()
may be true for the original member function declaration inside the class (as
there is some later definition that does have a body), but
isLateTemplateParsed() is not (it is only true for the later definition).  So
just skip any such declarations that are not definitions (which is sane anyway,
as otherwise such functions could pointlessly be inspected multiple times).

Change-Id: I724f652a8f060a931f8b5fc3e4feb5f307a922bf
Reviewed-on: https://gerrit.libreoffice.org/42914
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-29 13:31:23 +02:00
Stephan Bergmann
df8d092c3a Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
2017-05-18 09:56:01 +02:00
Stephan Bergmann
6661bdb076 Minor loplugin:unnecessaryoverride improvement
Change-Id: I3afb31b642a47e767dda0614d223b6b7f22e5d54
2017-03-13 17:24:09 +01:00
Stephan Bergmann
f2b4d84971 Fix loplugin:unnecessaryoverride
(user-provided virtual dtor in class with dependent base)

Change-Id: I37b3cc3d32e76a0286ecc91f999920e3dfe706cc
2017-03-13 14:22:08 +01:00
Noel Grandin
4511431fb6 improve "unnecessary user-declared destructor" check
to look for inline&empty destructors, where we can just let
the compiler do it's thing

Change-Id: Ibde8800bdfed6b77649c30ebc19921167c33dec3
Reviewed-on: https://gerrit.libreoffice.org/32999
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27 09:49:04 +00:00
Stephan Bergmann
03c215ab07 loplugin:unnecessaryoverride (dtors)
Change-Id: Ia38672028668959bf3d5541fe4ddb9fb72848617
2016-12-05 09:06:14 +01:00
Stephan Bergmann
682899e313 CXXDestructorDecl is already handled
...a few lines up, together with CXXConstructorDecl

Change-Id: Id9afd4d3936b2efb92de3c6ab950da78d876a5a8
2016-11-14 16:47:25 +01:00
Noel Grandin
5e997f4dba disable this chunk of loplugin code on clang < 3.8
not worth the spaghetti of making it work across version

Change-Id: I0de923b16fb6d58cbad55adc9878ab39bc0c86ae
2016-11-01 12:58:17 +02:00
Stephan Bergmann
7441141bcf No good reason for dbaccess::OCacheSet::updateRow to be pure?
Most of its virtual member functions are (though insertRow is already a curious
exception), even though they are defined, so smells like a copy/paste error
rather than deliberate design.  And appears to have been the only reason why
loplugin:unnecessaryoverride filtered out such overriding of pure base
functions.

Change-Id: Ib2a40af9cd3cd3dbb26c4147f7d01de4e11f5f6e
2016-10-31 11:38:49 +01:00
Noel Grandin
eaf32cd43c fix unnecessaryoverride clang plugin on clang < 3.8
Change-Id: Id78d694cf7271a6abf94234958ab623cf1cd93a5
2016-10-31 11:54:06 +02:00
Noel Grandin
8a22bc93e0 update unnecessaryoverride plugin to find pure forwarding methods
which can be replaced with using declarations.

Is there a more efficient way to code the search? Seems to slow the
build down a little.

Change-Id: I08cda21fa70dce6572e1acc71bf5e6df36bb951f
Reviewed-on: https://gerrit.libreoffice.org/30157
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-28 12:56:17 +00:00
Noel Grandin
62223f9a8a loplugin:unnecessaryoverride
Change-Id: I08c55a3023ec2e8990098eeb60e91cd18556e7ae
Reviewed-on: https://gerrit.libreoffice.org/29656
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-13 06:47:44 +00:00
Noel Grandin
36313d93ac improve unnecessaryoverride plugin
to ignore ImplicitCastExpr when calling superclass method

Change-Id: I76a3068446acfee85aa1baeb216e57f63c7099c1
Reviewed-on: https://gerrit.libreoffice.org/27279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-19 05:39:46 +00:00
Stephan Bergmann
e8b2fc7a92 Adapt to older Clang that don't have CompoundStmt::body_front
Change-Id: I41555c0a2b35ad950797f65e02ed1ee060c4bf0a
2016-07-18 11:46:41 +02:00
Stephan Bergmann
018e89337d Improve loplugin:unnecessaryoverride
<sberg> thorsten, remember what that "TODO" in
 SvxAccessibleTextPropertySet::getSupportedServiceNames was to be about exactly,
 in a909acb7009acadffa53e74ea05ddb88803490f1 ?
<thorsten> sberg: that's a nonsense, prolly copy'n'pasted, or a 'please review
 me'
<sberg> thorsten, OK, thanks (that override will eventually go away with
 loplugin:unnecessaryoverride, and the TODO comment be lost)

Change-Id: Iba964c61768459aac4067bbd4e1f7d4f78f6adac
Reviewed-on: https://gerrit.libreoffice.org/27232
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-15 14:08:07 +00:00
Noel Grandin
6e72f0251b new loplugin unnecessary override
Change-Id: I88d3e33823d68745b98625050a8a274f9ef04bcb
Reviewed-on: https://gerrit.libreoffice.org/27135
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-15 14:05:41 +00:00