Skip to content

Commit 26dccda

Browse files
Update checkclass.cpp
1 parent c8f80db commit 26dccda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkclass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2607,7 +2607,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, Member
26072607
return true;
26082608
}
26092609
if ((yield == Library::Container::Yield::ITEM || yield == Library::Container::Yield::AT_INDEX) &&
2610-
((parent && parent->isComparisonOp()) || lhs->isAssignmentOp()))
2610+
((parent && parent->isComparisonOp()) || lhs->isAssignmentOp() || (lhs->str() == "(" && Token::Match(lhs->astParent(), "%cop%"))))
26112611
return true; // assume that these functions have const overloads
26122612
return false;
26132613
};

0 commit comments

Comments
 (0)