From d3daf6e6ad1341e1e3aceed8dc15e873cb2c67af Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 13 Aug 2014 18:51:53 -0700 Subject: [PATCH] Mark unary expressions as 'interesting' if they have a '*' prefix. Fixes #194 --- analysis/unused.d | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/analysis/unused.d b/analysis/unused.d index f5897cc..e109a93 100644 --- a/analysis/unused.d +++ b/analysis/unused.d @@ -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