forked from qt-creator/qt-creator
ClangCodeModel: Relax check for const-ness
... when detecting output arguments with clangd. This should lead to fewer false positives. We plan to handle false negatives on a case-by-case basis (rather than the other way around). Change-Id: I541b418927dc410c2ea4ea9f6c1b5a7bd291a1a8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -2605,8 +2605,6 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
|
||||
const QList<AstNode> path = getAstPath(ast, range);
|
||||
if (path.size() < 2)
|
||||
return false;
|
||||
if (path.last().hasConstType())
|
||||
return false;
|
||||
for (auto it = path.rbegin() + 1; it != path.rend(); ++it) {
|
||||
if (it->kind() == "Call" || it->kind() == "CXXConstruct"
|
||||
|| it->kind() == "MemberInitializer") {
|
||||
@@ -2636,7 +2634,7 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
|
||||
|
||||
if (it->kind() == "Lambda")
|
||||
return false;
|
||||
if (it->kind().endsWith("Cast") && it->hasConstType())
|
||||
if (it->hasConstType())
|
||||
return false;
|
||||
if (it->kind() == "Member" && it->arcanaContains("(")
|
||||
&& !it->arcanaContains("bound member function type")) {
|
||||
|
||||
Reference in New Issue
Block a user