Clang: Remove extern and static declarations from symbol outline...

... in case they appear within the function body.

Task-number: QTCREATORBUG-20434
Change-Id: I6d12ab857cca5fe8479ac3fb426329ae7d732567
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-06-01 09:22:03 +02:00
parent b0c0119345
commit 52bd5173fb

View File

@@ -80,6 +80,17 @@ void buildTree(const TokenContainers &containers,
if (lexicalParentIndex >= 0 && treeItemCache[lexicalParentIndex])
parent = treeItemCache[lexicalParentIndex];
if (parent != root
&& (container.extraInfo.storageClass == ClangBackEnd::StorageClass::Extern
|| container.extraInfo.storageClass == ClangBackEnd::StorageClass::Static)) {
ClangBackEnd::HighlightingType parentType = parent->token.types.mainHighlightingType;
if (parentType == ClangBackEnd::HighlightingType::VirtualFunction
|| parentType == ClangBackEnd::HighlightingType::Function) {
// Treat static and extern variables inside a function scope as local variables.
continue;
}
}
parent->appendChild(item.release());
}