clangbackend: Try harder to get the proper cursor

... in cases where it appears that clang_annotateTokens() did not do
what we wanted.

Fixes: QTCREATORBUG-21522
Change-Id: I272061cb6c4b51a5d779ace5b4e06912c0a386e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-11-20 12:26:33 +01:00
parent fc216b4838
commit b0dd6b748f
3 changed files with 27 additions and 1 deletions

View File

@@ -1769,6 +1769,13 @@ TEST_F(TokenProcessor, StructuredBinding)
ASSERT_THAT(infos[5], IsHighlightingMark(737u, 20u, 1u, HighlightingType::LocalVariable));
}
TEST_F(TokenProcessor, IndirectMacro)
{
const auto infos = translationUnit.tokenInfosInRange(sourceRange(746, 32));
ASSERT_THAT(infos[5], IsHighlightingMark(746u, 20u, 10u, HighlightingType::LocalVariable));
}
Data *TokenProcessor::d;
void TokenProcessor::SetUpTestCase()