Silence loplugin:staticmethods when the definition involves preprocessing
...to help avoid false positives. (Another option to silence such warnings is to add (void) this; to false-positive function bodies, but this new approach may be more natural in certain cases.) Change-Id: Ie6ea908730c596dbfb62ff42ae60dbd0a00a8fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100152 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -218,6 +218,10 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (containsPreprocessingConditionalInclusion((pCXXMethodDecl->getSourceRange()))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"this member function can be declared static",
|
||||
|
Reference in New Issue
Block a user