From 24db81adb5a6f5517fba98f9a26e6b1b5440aded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 19 Oct 2019 18:50:27 +0200 Subject: [PATCH] Fixed #8903 (False positive 'shadows outer variable' when using GCC statement expressions) --- lib/checkother.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index c90c8a9b3..05a0bf099 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -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) {