From 6081054f892d99df20ecf6160e8f35ffab75772a Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 6 Feb 2023 16:50:24 +0800 Subject: [PATCH] fix: Don't expose functions who's parent can't be found in the global scope. --- RedPandaIDE/parser/cppparser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index de0ed5b4..02e08abb 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -2611,6 +2611,10 @@ void CppParser::handleMethod(StatementKind functionKind,const QString &sType, co if (splitLastMember(sName,scopelessName,parentClassName)) { // Provide Bar instead of Foo::Bar scopeStatement = getIncompleteClass(parentClassName,getCurrentScope()); + + //parent not found + if (!parentClassName.isEmpty() && !scopeStatement) + scopelessName=sName; } else scopelessName = sName;