diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index d2fbcd808..ef825309f 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2864,7 +2864,12 @@ void SymbolDatabase::printOut(const char *title) const std::cout << " name: " << type->name() << std::endl; std::cout << " classDef: " << tokenToString(type->classDef, mTokenizer) << std::endl; std::cout << " classScope: " << type->classScope << std::endl; - std::cout << " enclosingScope: " << type->enclosingScope << std::endl; + std::cout << " enclosingScope: " << type->enclosingScope; + if (type->enclosingScope) { + std::cout << " " << type->enclosingScope->type << " " + << type->enclosingScope->className; + } + std::cout << std::endl; std::cout << " needInitialization: " << (type->needInitialization == Type::Unknown ? "Unknown" : type->needInitialization == Type::True ? "True" : type->needInitialization == Type::False ? "False" : @@ -5654,11 +5659,11 @@ std::string ValueType::str() const ret += " long double"; else if ((type == ValueType::Type::NONSTD || type == ValueType::Type::RECORD) && typeScope) { std::string className(typeScope->className); - const Scope *scope = typeScope->nestedIn; + const Scope *scope = typeScope->definedType ? typeScope->definedType->enclosingScope : typeScope->nestedIn; while (scope && scope->type != Scope::eGlobal) { if (scope->type == Scope::eClass || scope->type == Scope::eStruct || scope->type == Scope::eNamespace) className = scope->className + "::" + className; - scope = scope->nestedIn; + scope = scope->definedType ? scope->definedType->enclosingScope : scope->nestedIn; } ret += ' ' + className; } else if (type == ValueType::Type::CONTAINER && container) {