forked from qt-creator/qt-creator
ClangCodeModel: Fix erroneous marking of lambda parameter
... as output argument when using clangd. Change-Id: I35ef2da235cb317bb7eb1f08b865ea62c27d3b76 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -2453,6 +2453,8 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (it->kind() == "Lambda")
|
||||||
|
return false;
|
||||||
if (it->kind().endsWith("Cast") && it->hasConstType())
|
if (it->kind().endsWith("Cast") && it->hasConstType())
|
||||||
return false;
|
return false;
|
||||||
if (it->kind() == "Member" && it->arcanaContains("(")
|
if (it->kind() == "Member" && it->arcanaContains("(")
|
||||||
|
@@ -1250,6 +1250,8 @@ void ClangdTestHighlighting::test_data()
|
|||||||
<< QList<int>{C_LOCAL} << 0;
|
<< QList<int>{C_LOCAL} << 0;
|
||||||
QTest::newRow("simple assignment") << 835 << 5 << 835 << 6 << QList<int>{C_LOCAL} << 0;
|
QTest::newRow("simple assignment") << 835 << 5 << 835 << 6 << QList<int>{C_LOCAL} << 0;
|
||||||
QTest::newRow("simple return") << 841 << 12 << 841 << 15 << QList<int>{C_LOCAL} << 0;
|
QTest::newRow("simple return") << 841 << 12 << 841 << 15 << QList<int>{C_LOCAL} << 0;
|
||||||
|
QTest::newRow("lambda parameter") << 847 << 49 << 847 << 52
|
||||||
|
<< QList<int>{C_PARAMETER, C_DECLARATION} << 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangdTestHighlighting::test()
|
void ClangdTestHighlighting::test()
|
||||||
|
@@ -840,3 +840,9 @@ FooPtrVector returnTest() {
|
|||||||
FooPtrVector foo;
|
FooPtrVector foo;
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Container, typename Func> inline void useContainer(const Container &, Func) {}
|
||||||
|
void testConstRefAutoLambdaArgs()
|
||||||
|
{
|
||||||
|
useContainer(FooPtrVector(), [](const auto &arg) {});
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user