diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-10-15 15:01:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-10-15 17:15:21 +0200 |
commit | 7dc2ac46be574b59cac7923ac55cf650c4fd1168 (patch) | |
tree | 2aebddc30965533e3034c68d3b465533abd081a6 /compilerplugins | |
parent | 78db0dcfb6f5a8d5baa2daae7e17733d4c7c0a0c (diff) |
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.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/unnecessaryoverride.cxx | 7 |
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; |