Skip to content

Commit

Permalink
Specific operator
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jul 11, 2023
1 parent 7d0106b commit d212760
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2468,8 +2468,9 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, Member
auto hasOverloadedMemberAccess = [](const Token* end, const Scope* scope) -> bool {
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." || f.name() == "operator->");
const std::string op = "operator" + end->astParent()->originalName();
auto it = std::find_if(scope->functionList.begin(), scope->functionList.end(), [&op](const Function& f) {
return f.isConst() && f.name() == op;
});
if (it == scope->functionList.end() || !it->retType || !it->retType->classScope)
return false;
Expand Down

0 comments on commit d212760

Please sign in to comment.