From d64aef25818dafc605185933bed53c6f1ba669fa Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Sat, 1 Jul 2023 01:54:41 +0200 Subject: [PATCH] Fix FP uselessOverride --- lib/symboldatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 7f09400345c..6fb5acbec75 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -4388,13 +4388,13 @@ const Function * Function::getOverriddenFunctionRecursive(const ::Type* baseType auto range = parent->functionMap.equal_range(tokenDef->str()); for (std::multimap::const_iterator it = range.first; it != range.second; ++it) { const Function * func = it->second; - if (func->hasVirtualSpecifier()) { // Base is virtual and of same name + if (func->isImplicitlyVirtual()) { // Base is virtual and of same name const Token *temp1 = func->tokenDef->previous(); const Token *temp2 = tokenDef->previous(); bool match = true; // check for matching return parameters - while (temp1->str() != "virtual") { + while (!Token::Match(temp1, "virtual|{|}|;")) { if (temp1->str() != temp2->str() && !(temp1->str() == derivedFromType->name() && temp2->str() == baseType->name())) {