clangbackend: Provide highlighting for structured bindings

These are reported by libclang as "unexposed declarations".

Fixes: QTCREATORBUG-24769
Change-Id: I7a74b707f4203becabaa74b90758a7b396ee23bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-10-23 16:37:59 +02:00
parent 9c0544c386
commit 2b32b2e440
3 changed files with 14 additions and 0 deletions

View File

@@ -1759,6 +1759,14 @@ TEST_F(TokenProcessor, TemplateAlias)
ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias));
}
TEST_F(TokenProcessor, StructuredBinding)
{
const auto infos = translationUnit.tokenInfosInRange(sourceRange(737, 23));
ASSERT_THAT(infos[3], IsHighlightingMark(737u, 17u, 1u, HighlightingType::LocalVariable));
ASSERT_THAT(infos[5], IsHighlightingMark(737u, 20u, 1u, HighlightingType::LocalVariable));
}
Data *TokenProcessor::d;
void TokenProcessor::SetUpTestCase()