fix: Correctly parsing array defines.

This commit is contained in:
Roy Qu 2024-05-03 21:00:38 +08:00
parent ebeea19794
commit 4bd3829484
1 changed files with 1 additions and 2 deletions

View File

@ -2299,7 +2299,7 @@ void CppParser::checkAndHandleMethodOrVar(KeywordType keywordType, int maxIndex)
mIndex,
isStatic, maxIndex);
return;
} else if (mTokenizer[mIndex]->text.startsWith("[")) {
} else if (mTokenizer[mIndex]->text.startsWith("[") && AutoTypes.contains(sType)) {
handleStructredBinding(sType,maxIndex);
return;
} else if (mTokenizer[mIndex + 1]->text == '(') {
@ -3924,7 +3924,6 @@ void CppParser::handleStructs(bool isTypedef, int maxIndex)
void CppParser::handleStructredBinding(const QString &sType, int maxIndex)
{
if (mIndex+1 < maxIndex
&& AutoTypes.contains(sType)
&& ((mTokenizer[mIndex+1]->text == ":")
|| (mTokenizer[mIndex+1]->text == "="))) {
QString typeName;