From f6161c6f89b386beeb8b411be94956e863f68fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 31 Jan 2016 09:11:52 +0100 Subject: [PATCH] CheckUnusedVar: My fix for #4955 was a quick fix causing false negatives. Fix some FN and add TODO to handle other FN better. --- lib/checkunusedvar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 238857fea..0ec4c56b9 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -772,8 +772,10 @@ void CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(const Scope* const break; } if (tok->isName() && tok->str().back() == '>') { + // TODO: This is a quick fix to handle when constants are used + // as template parameters. Try to handle this better, perhaps + // only remove constants. variables.clear(); - break; } // bailout when for_each is used