From 6e1376dd60442275f34a58cf7b7c8e54b0902f78 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 29 Oct 2019 08:08:38 +0200 Subject: 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 --- compilerplugins/clang/finalclasses.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compilerplugins/clang') 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()) - 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()) + return true; bool bFoundVirtual = false; bool bFoundProtected = false; for (auto it = decl->method_begin(); it != decl->method_end(); ++it) { -- cgit v1.2.3