diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-29 08:08:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-29 09:01:02 +0100 |
commit | 6e1376dd60442275f34a58cf7b7c8e54b0902f78 (patch) | |
tree | 280f81d93f76cf01dded1fca686bdd36aaafef05 /compilerplugins | |
parent | 5d1709a7c4184eb31cfc4c2d3acadff3a4a68189 (diff) |
loplugin:finalclasses fix check
need to check after we generate the inherited-from set, not before
Change-Id: Ic66deeb680f4a2505d66f99872ac7a5bc263cda9
Reviewed-on: https://gerrit.libreoffice.org/81636
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/finalclasses.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compilerplugins/clang/finalclasses.cxx b/compilerplugins/clang/finalclasses.cxx index e7704ca8fc0c..10948790697f 100644 --- a/compilerplugins/clang/finalclasses.cxx +++ b/compilerplugins/clang/finalclasses.cxx @@ -93,8 +93,6 @@ bool FinalClasses::VisitCXXRecordDecl(const CXXRecordDecl* decl) decl = decl->getCanonicalDecl(); if (!decl->hasDefinition()) return true; - if (decl->hasAttr<FinalAttr>()) - return true; for (auto it = decl->bases_begin(); it != decl->bases_end(); ++it) { @@ -107,6 +105,8 @@ bool FinalClasses::VisitCXXRecordDecl(const CXXRecordDecl* decl) checkBase(spec.getType()); } + if (decl->hasAttr<FinalAttr>()) + return true; bool bFoundVirtual = false; bool bFoundProtected = false; for (auto it = decl->method_begin(); it != decl->method_end(); ++it) { |