- fix: Alias a namespace to itself will create infinite loop.

This commit is contained in:
Roy Qu 2024-04-08 13:57:16 +08:00
parent 396b6f42dc
commit 4f1cc3d50d
2 changed files with 18 additions and 14 deletions

View File

@ -129,6 +129,7 @@ Red Panda C++ Version 2.27
- change: Completion popup size settings are based on editor's char width/line height.
- change: Remove "limit for copy" and "limit for undo" options.
- fix: Can't find the correct type if current symbol is member of a class that has constructors.
- fix: Alias a namespace to itself will create infinite loop.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -3203,20 +3203,23 @@ void CppParser::handleNamespace(KeywordType skipType, int maxIndex)
}
//qDebug()<<command<<aliasName;
//namespace alias
addStatement(
getCurrentScope(),
mCurrentFile,
aliasName, // name of the alias namespace
command, // command
"", // args
"", // noname args
"", // values
//mTokenizer[mIndex]^.Line,
startLine,
StatementKind::NamespaceAlias,
getScope(),
mCurrentMemberAccessibility,
StatementProperty::HasDefinition);
if (aliasName != command
&& aliasName != getFullStatementName(command, getCurrentScope())) {
addStatement(
getCurrentScope(),
mCurrentFile,
aliasName, // name of the alias namespace
command, // command
"", // args
"", // noname args
"", // values
//mTokenizer[mIndex]^.Line,
startLine,
StatementKind::NamespaceAlias,
getScope(),
mCurrentMemberAccessibility,
StatementProperty::HasDefinition);
}
mIndex++; // skip ;
return;
} else if (isInline) {