diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 1a42f8ab820..cbf21898579 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -3327,6 +3327,8 @@ void CheckClass::checkReturnByReference() for (const Function& func : classScope->functionList) { if (Function::returnsPointer(&func) || Function::returnsReference(&func) || Function::returnsStandardType(&func)) continue; + if (func.isImplicitlyVirtual()) + continue; if (const Variable* var = getSingleReturnVar(func.functionScope)) { if (!var->valueType()) continue;