Skip to content

Commit e6ab8f4

Browse files
IOBYTEdanmar
authored andcommitted
Symbol database: improved handling of array members
1 parent 37716fb commit e6ab8f4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,10 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
858858
const Scope *func = functionScopes[i];
859859
for (const Token *tok = func->classStart->next(); tok != func->classEnd; tok = tok->next()) {
860860
// check for member variable
861-
if (tok && tok->varId() && tok->next() && tok->next()->str() == ".") {
862-
const Token *tok1 = tok->tokAt(2);
861+
if (tok && tok->varId() && tok->next() &&
862+
(tok->next()->str() == "." ||
863+
(tok->next()->str() == "[" && tok->linkAt(1)->strAt(1) == "."))) {
864+
const Token *tok1 = tok->next()->str() == "." ? tok->tokAt(2) : tok->linkAt(1)->tokAt(2);
863865
if (tok1 && tok1->varId() && _variableList[tok1->varId()] == 0) {
864866
const Variable *var = _variableList[tok->varId()];
865867
if (var && var->typeScope()) {

0 commit comments

Comments
 (0)