ClangCodeModel: Fix mis-highlighting of lambda calls

Calls to lambdas without arguments that are declared as const variables
were erroneously displayed as output arguments.

Change-Id: Ibd914431a34157606694f85d8e00c0dd1db1a618
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-02-11 13:08:20 +01:00
parent bb59a00229
commit 81218043d0
3 changed files with 43 additions and 1 deletions

View File

@@ -1285,6 +1285,14 @@ void ClangdTestHighlighting::test_data()
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("const member as function argument") << 868 << 32 << 868 << 43
<< QList<int>{C_FIELD} << 0;
QTest::newRow("lambda call without arguments (const var)") << 887 << 5 << 887 << 12
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("lambda call without arguments (non-const var)") << 889 << 5 << 889 << 12
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("non-const operator()") << 898 << 5 << 898 << 7
<< QList<int>{C_LOCAL} << 0;
QTest::newRow("const operator()") << 903 << 5 << 903 << 7
<< QList<int>{C_LOCAL} << 0;
}
void ClangdTestHighlighting::test()