Mark unary expressions as 'interesting' if they have a '*' prefix. Fixes #194

This commit is contained in:
Hackerpilot 2014-08-13 18:51:53 -07:00
parent a4d221a569
commit d3daf6e6ad
1 changed files with 9 additions and 0 deletions

View File

@ -186,6 +186,15 @@ class UnusedVariableCheck : BaseAnalyzer
variableUsed(single.token.text);
}
override void visit(const UnaryExpression unary)
{
if (unary.prefix == tok!"*")
interestDepth++;
unary.accept(this);
if (unary.prefix == tok!"*")
interestDepth--;
}
override void visit(const PrimaryExpression primary)
{
if (interestDepth > 0 && primary.identifierOrTemplateInstance !is null