forked from qt-creator/qt-creator
Clang: Fix access specifier for variables
Static members have a variable declaration kind so we need to check their access specifiers in order to provide proper information about tokens. Fixes: QTCREATORBUG-22082 Change-Id: If455174bd346398a2df3499fa6cf1ea2b4e26965 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -1704,6 +1704,24 @@ TEST_F(TokenProcessor, LambdaLocalVariableCapture)
|
||||
ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable));
|
||||
}
|
||||
|
||||
TEST_F(TokenProcessor, StaticProtectedMember)
|
||||
{
|
||||
const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(693, 31));
|
||||
|
||||
ClangBackEnd::TokenInfoContainer container(infos[2]);
|
||||
|
||||
ASSERT_THAT(container.extraInfo.accessSpecifier, ClangBackEnd::AccessSpecifier::Protected);
|
||||
}
|
||||
|
||||
TEST_F(TokenProcessor, StaticPrivateMember)
|
||||
{
|
||||
const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(696, 29));
|
||||
|
||||
ClangBackEnd::TokenInfoContainer container(infos[2]);
|
||||
|
||||
ASSERT_THAT(container.extraInfo.accessSpecifier, ClangBackEnd::AccessSpecifier::Private);
|
||||
}
|
||||
|
||||
Data *TokenProcessor::d;
|
||||
|
||||
void TokenProcessor::SetUpTestCase()
|
||||
|
||||
Reference in New Issue
Block a user