summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-10-15 15:01:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-10-15 17:15:21 +0200
commit7dc2ac46be574b59cac7923ac55cf650c4fd1168 (patch)
tree2aebddc30965533e3034c68d3b465533abd081a6 /compilerplugins
parentScriptForge - new SFWidgets library, new PopupMenu service (diff)
downloadcore-7dc2ac46be574b59cac7923ac55cf650c4fd1168.tar.gz
core-7dc2ac46be574b59cac7923ac55cf650c4fd1168.zip
loplugin:unnecessaryoverride corner case is subsumed now
...by modifications done to the plugin in af908d9f18fbb83a5c393f856026cebefd821f18 "Avoid usage of incomplete types in member functions defined in-class" (if the dtor's definition is spelled `= default;` rather than `{}`, but which should always be possible) Change-Id: Iddce2baf3635a12131854e86a609951309ffbc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/test/unnecessaryoverride-dtor.cxx2
-rw-r--r--compilerplugins/clang/unnecessaryoverride.cxx7
2 files changed, 1 insertions, 8 deletions
diff --git a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
index 8ed472749105..960909b4ea4c 100644
--- a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
+++ b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
@@ -125,7 +125,7 @@ struct CompleteBase {
// a class defined in a .hxx with the dtor declared (but not defined) as inline in the .hxx,
// and then defined in the cxx (making it effectively only callable from within the cxx);
// removing the dtor declaration from the class definition would change the dtor to be callable from everywhere
-MarkedInlineButNotDefined::~MarkedInlineButNotDefined() {}
+MarkedInlineButNotDefined::~MarkedInlineButNotDefined() = default;
// avoid loplugin:unreffun:
int main() {
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx
index 0641339d4e6f..7e7d39a0a5d8 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -193,13 +193,6 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
return true;
}
}
- // corner case
- if (methodDecl->isInlined()
- && compiler.getSourceManager().isInMainFile(methodDecl->getLocation())
- && !compiler.getSourceManager().isInMainFile(methodDecl->getCanonicalDecl()->getLocation()))
- {
- return true;
- }
if (methodDecl->isExplicitlyDefaulted()) {
if (methodDecl->getPreviousDecl() != nullptr) {
return true;