File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4173,9 +4173,13 @@ void CheckOther::checkShadowVariables()
41734173 (functionScope->function ->isStatic () || functionScope->function ->isFriend ()) &&
41744174 shadowed->variable () && !shadowed->variable ()->isLocal ())
41754175 return ;
4176- if (var.scope () && var.scope ()->function && var.scope ()->function ->isConstructor ()
4177- && shadowed->variable () && shadowed->variable ()->isMember ())
4178- return ;
4176+ if (var.scope () && var.scope ()->function && var.scope ()->function ->isConstructor ()) {
4177+ if (shadowed->variable () && shadowed->variable ()->isMember ())
4178+ return ;
4179+ if (shadowed->function () && shadowed->function ()->nestedIn &&
4180+ shadowed->function ()->nestedIn ->isClassOrStruct ())
4181+ return ;
4182+ }
41794183 shadowError (var.nameToken (), var.isArgument () ? " argument" : " local variable" ,
41804184 shadowed, (shadowed->varId () != 0 ) ?
41814185 (shadowed->variable ()->isMember () ? " member" : " variable" ) : " function" );
You can’t perform that action at this time.
0 commit comments