Skip to content

Commit

Permalink
Update astutils.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 8, 2024
1 parent bd8cb94 commit 5cec170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ const Token* getParentLifetime(const Token* tok, const Library* library)
const Variable* var = tok2->variable();
if (var)
return var->isLocal() || var->isArgument();
if (Token::simpleMatch(tok2, "["))
if (Token::simpleMatch(tok2, "[") && !Token::simpleMatch(tok2->astParent(), "."))
return true;
return isTemporary(tok2, library);
});
Expand Down

0 comments on commit 5cec170

Please sign in to comment.