diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp index e105cf48b43a50f4fd5b5fbe6e1639e0de12745b..cb224af3e22756930ac80f1defd5c5c06901d250 100644 --- a/src/plugins/cppeditor/cppchecksymbols.cpp +++ b/src/plugins/cppeditor/cppchecksymbols.cpp @@ -464,17 +464,26 @@ bool CheckSymbols::visit(CallAST *ast) const QByteArray expression = textOf(access); const QList<LookupItem> candidates = typeOfExpression(expression, scope, TypeOfExpression::Preprocess); - addVirtualMethodUsage(candidates, access->member_name, argumentCount); + + NameAST *memberName = access->member_name; + if (QualifiedNameAST *q = memberName->asQualifiedName()) + memberName = q->unqualified_name; + + addVirtualMethodUsage(candidates, memberName, argumentCount); } } } else if (IdExpressionAST *idExpr = ast->base_expression->asIdExpression()) { if (const Name *name = idExpr->name->name) { if (maybeVirtualMethod(name)) { + NameAST *exprName = idExpr->name; + if (QualifiedNameAST *q = exprName->asQualifiedName()) + exprName = q->unqualified_name; + Scope *scope = findScope(idExpr); const QByteArray expression = textOf(idExpr); const QList<LookupItem> candidates = typeOfExpression(expression, scope, TypeOfExpression::Preprocess); - addVirtualMethodUsage(candidates, idExpr->name, argumentCount); + addVirtualMethodUsage(candidates, exprName, argumentCount); } } }