ClangCodeModel: Fix another output argument mis-detection

We need to relax the range check: In expressions such as x.y->z, the
second argument for the operator->call is x.y, not just y.

Fixes: QTCREATORBUG-27352
Change-Id: Ida542c11c129630f0a1d301508ec5f8076eb9902
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-04-08 16:29:36 +02:00
parent d2e1590aec
commit 06ce449a01
3 changed files with 12 additions and 1 deletions

View File

@@ -2735,7 +2735,7 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
// The callable is never displayed as an output parameter.
// TODO: A good argument can be made to display objects on which a non-const
// operator or function is called as output parameters.
if (children.at(1).range() == range)
if (children.at(1).range().contains(range))
return false;
QList<AstNode> firstChildTree{children.first()};