From 3a86262244c0ebd4750cded0849a5a65f7aca458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 6 Jan 2021 08:53:13 +0100 Subject: [PATCH] SymbolDatabase: Do not set definedType for global scope etc --- lib/symboldatabase.cpp | 3 +++ test/cli/test-clang-import.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 36bbf08a1..b8b77a50e 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -854,6 +854,9 @@ void SymbolDatabase::createSymbolDatabaseNeedInitialization() unknowns = 0; for (Scope& scope : scopeList) { + if (!scope.isClassOrStructOrUnion()) + continue; + if (!scope.definedType) { mBlankTypes.emplace_back(); scope.definedType = &mBlankTypes.back(); diff --git a/test/cli/test-clang-import.py b/test/cli/test-clang-import.py index bee6bbeca..7a9ca8484 100644 --- a/test/cli/test-clang-import.py +++ b/test/cli/test-clang-import.py @@ -12,7 +12,6 @@ def get_debug_section(title, stdout): s = re.sub(r'nestedIn: Struct', 'nestedIn: Class', s) s = re.sub(r'classDef: struct', 'classDef: class', s) s = re.sub(r'isInline: [a-z]+', 'isInline: ---', s) - s = re.sub(r'definedType: .*', 'definedType: ---', s) s = re.sub(r'needInitialization: .*', 'needInitialization: ---', s) s = re.sub(r'functionOf: .*', 'functionOf: ---', s) s = re.sub(r'0x12345678 Struct', '0x12345678 Class', s)