File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1943,13 +1943,16 @@ void CheckOtherImpl::checkConstPointer()
19431943 if (deref == MEMBER) {
19441944 if (!gparent)
19451945 continue ;
1946- if (parent->astOperand2 ()) {
1947- if (parent->astOperand2 ()->function () && parent->astOperand2 ()->function ()->isConst ())
1946+ const Token* funcParent = parent;
1947+ while (Token::simpleMatch (funcParent->astParent (), " ." ))
1948+ funcParent = funcParent->astParent ();
1949+ if (funcParent->astOperand2 ()) {
1950+ if (funcParent->astOperand2 ()->function () && funcParent->astOperand2 ()->function ()->isConst ())
19481951 continue ;
1949- if (mSettings .library .isFunctionConst (parent ->astOperand2 ()))
1952+ if (mSettings .library .isFunctionConst (funcParent ->astOperand2 ()))
19501953 continue ;
1951- if (parent ->astOperand2 ()->varId ()) {
1952- if (gparent->str () == " ?" && astIsLHS (parent ))
1954+ if (funcParent ->astOperand2 ()->varId ()) {
1955+ if (gparent->str () == " ?" && astIsLHS (funcParent ))
19531956 continue ;
19541957 }
19551958 }
You can’t perform that action at this time.
0 commit comments