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;
|
||||
}
|
||||
|
||||
if (it->kind() == "Lambda")
|
||||
return false;
|
||||
if (it->kind().endsWith("Cast") && it->hasConstType())
|
||||
return false;
|
||||
if (it->kind() == "Member" && it->arcanaContains("(")
|
||||
|
@@ -1250,6 +1250,8 @@ void ClangdTestHighlighting::test_data()
|
||||
<< 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("lambda parameter") << 847 << 49 << 847 << 52
|
||||
<< QList<int>{C_PARAMETER, C_DECLARATION} << 0;
|
||||
}
|
||||
|
||||
void ClangdTestHighlighting::test()
|
||||
|
@@ -840,3 +840,9 @@ FooPtrVector returnTest() {
|
||||
FooPtrVector 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