Skip to content

Commit

Permalink
Check both . and ->
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jul 11, 2023
1 parent c054ccf commit 92d5968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, Member
if (!end || !scope || !Token::simpleMatch(end->astParent(), "."))
return false;
auto it = std::find_if(scope->functionList.begin(), scope->functionList.end(), [](const Function& f) {
return f.isConst() && f.name() == "operator->";
return f.isConst() && (f.name() == "operator->" || f.name() == "operator->");
});
if (it == scope->functionList.end() || !it->retType || !it->retType->classScope)
return false;
Expand Down

0 comments on commit 92d5968

Please sign in to comment.