Fixed #8903 (False positive 'shadows outer variable' when using GCC statement expressions)
This commit is contained in:
parent
dc7cf10962
commit
24db81adb5
|
@ -2921,6 +2921,9 @@ void CheckOther::checkShadowVariables()
|
||||||
while (functionScope && functionScope->type != Scope::ScopeType::eFunction && functionScope->type != Scope::ScopeType::eLambda)
|
while (functionScope && functionScope->type != Scope::ScopeType::eFunction && functionScope->type != Scope::ScopeType::eLambda)
|
||||||
functionScope = functionScope->nestedIn;
|
functionScope = functionScope->nestedIn;
|
||||||
for (const Variable &var : scope.varlist) {
|
for (const Variable &var : scope.varlist) {
|
||||||
|
if (var.nameToken() && var.nameToken()->isExpandedMacro())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (functionScope && functionScope->type == Scope::ScopeType::eFunction && functionScope->function) {
|
if (functionScope && functionScope->type == Scope::ScopeType::eFunction && functionScope->function) {
|
||||||
bool shadowArg = false;
|
bool shadowArg = false;
|
||||||
for (const Variable &arg : functionScope->function->argumentList) {
|
for (const Variable &arg : functionScope->function->argumentList) {
|
||||||
|
|
Loading…
Reference in New Issue