From ba0ee1747ba3ae2ef4fd2d364cb003bd9712900b Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:08:30 +0200 Subject: [PATCH] Update checkclass.cpp --- lib/checkclass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index ac88b46183b..f8b67684cf5 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -3326,7 +3326,10 @@ static const Variable* getSingleReturnVar(const Scope* scope) { return nullptr; if (!start->astOperand1() || start->str() != "return") return nullptr; - return start->astOperand1()->variable(); + const Token* tok = start->astOperand1(); + if (tok->str() == ".") + tok = tok->astOperand2(); + return tok->variable(); } void CheckClass::checkReturnByReference()