fix: Don't expose functions who's parent can't be found in the global scope.

This commit is contained in:
Roy Qu 2023-02-06 16:50:24 +08:00
parent 4fc3900796
commit 6081054f89
1 changed files with 4 additions and 0 deletions

View File

@ -2611,6 +2611,10 @@ void CppParser::handleMethod(StatementKind functionKind,const QString &sType, co
if (splitLastMember(sName,scopelessName,parentClassName)) { if (splitLastMember(sName,scopelessName,parentClassName)) {
// Provide Bar instead of Foo::Bar // Provide Bar instead of Foo::Bar
scopeStatement = getIncompleteClass(parentClassName,getCurrentScope()); scopeStatement = getIncompleteClass(parentClassName,getCurrentScope());
//parent not found
if (!parentClassName.isEmpty() && !scopeStatement)
scopelessName=sName;
} else } else
scopelessName = sName; scopelessName = sName;