Skip to content

Commit ee2cb98

Browse files
Update checkclass.cpp
1 parent 19faaee commit ee2cb98

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/checkclass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,10 @@ void CheckClass::initializationListUsage()
12261226
allowed = false;
12271227
return ChildrenToVisit::done;
12281228
}
1229+
if (var2->isLocal() && isVariableChanged(var2->nameToken(), previousBeforeAstLeftmostLeaf(tok), var2->declarationId(), /*globalvar*/ false, *mSettings)) {
1230+
allowed = false;
1231+
return ChildrenToVisit::done;
1232+
}
12291233
} else if (tok2->str() == "this") { // 'this' instance is not completely constructed in initialization list
12301234
allowed = false;
12311235
return ChildrenToVisit::done;

0 commit comments

Comments
 (0)