From 92d5968992816a591c3b01eeab89872cf122b717 Mon Sep 17 00:00:00 2001 From: chrchr Date: Tue, 11 Jul 2023 15:31:40 +0200 Subject: [PATCH] Check both . and -> --- lib/checkclass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 715fafc14be..e26b01c1377 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -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;