Fixed #8903 (False positive 'shadows outer variable' when using GCC statement expressions)

This commit is contained in:
Daniel Marjamäki 2019-10-19 18:50:27 +02:00
parent dc7cf10962
commit 24db81adb5
1 changed files with 3 additions and 0 deletions

View File

@ -2921,6 +2921,9 @@ void CheckOther::checkShadowVariables()
while (functionScope && functionScope->type != Scope::ScopeType::eFunction && functionScope->type != Scope::ScopeType::eLambda)
functionScope = functionScope->nestedIn;
for (const Variable &var : scope.varlist) {
if (var.nameToken() && var.nameToken()->isExpandedMacro())
continue;
if (functionScope && functionScope->type == Scope::ScopeType::eFunction && functionScope->function) {
bool shadowArg = false;
for (const Variable &arg : functionScope->function->argumentList) {