diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx index 166ae654f99f..5102faab7a78 100644 --- a/compilerplugins/clang/unnecessaryoverride.cxx +++ b/compilerplugins/clang/unnecessaryoverride.cxx @@ -114,10 +114,6 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) // operator to change from being an obsolete feature to being a standard // feature. That difference is not taken into account here. auto cls = methodDecl->getParent(); - if (methodDecl->isVirtual() && cls->getNumBases() == 0) - { - return true; - } if (methodDecl->getAccess() != AS_public) { return true; @@ -131,6 +127,7 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) // if it's virtual, but it has a base-class with a non-virtual destructor if (methodDecl->isVirtual()) { + bool baseWithVirtualDtor = false; for (auto baseSpecifier = cls->bases_begin(); baseSpecifier != cls->bases_end(); ++baseSpecifier) { const RecordType* baseRecordType = baseSpecifier->getType()->getAs(); @@ -138,15 +135,16 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) { const CXXRecordDecl* baseRecordDecl = dyn_cast(baseRecordType->getDecl()); if (baseRecordDecl && baseRecordDecl->getDestructor() - && !baseRecordDecl->getDestructor()->isVirtual()) + && baseRecordDecl->getDestructor()->isVirtual()) { - return true; + baseWithVirtualDtor = true; + break; } } - else - { - return true; // dependent base - } + } + if (!baseWithVirtualDtor) + { + return true; } } // corner case diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index aa18474c3470..7b06cc143e6c 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -245,7 +245,6 @@ public: SwUnoCursor& GetCursor(); sw::UnoCursorPointer m_pUnoCursor; SwFrameFormat* GetFrameFormat() const { return const_cast(static_cast(GetRegisteredIn())); } - virtual ~SwXTextTableCursor() override { }; }; struct SwRangeDescriptor diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 8bb35fc707da..c4cbeebad1d3 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -192,9 +192,6 @@ public: maTempFile.EnableKillingFile(); } - virtual ~SwModelTestBase() override - {} - virtual void setUp() override { test::BootstrapFixture::setUp();