From 1d441f64c15954004d56d1b981c02969b953eb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 17 Nov 2019 15:44:57 +0100 Subject: [PATCH] CheckUnusedVar: Quick heuristic so we don't bailout for 'auto' variables --- lib/checkunusedvar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index d79313aaa..42b507daf 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -1223,7 +1223,7 @@ void CheckUnusedVar::checkFunctionVariableUsage() FwdAnalysis fwdAnalysis(mTokenizer->isCPP(), mSettings->library); if (fwdAnalysis.unusedValue(expr, start, scope->bodyEnd)) { - if (!bailoutTypeName.empty()) { + if (!bailoutTypeName.empty() && bailoutTypeName != "auto") { if (mSettings->checkLibrary && mSettings->isEnabled(Settings::INFORMATION)) { reportError(tok, Severity::information,