Clang: Fix anonymous namespaces spelling

Follow-up for d2b951565a. Handle anonymous namespaces
via USR because they don't have displayName.

Change-Id: I5c747951ce406963a0c9a22ff78c92678909a61c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-09 14:52:58 +02:00
parent 1567679b81
commit 934e9b2e19

View File

@@ -49,8 +49,11 @@ FullTokenInfo::operator TokenInfoContainer() const
static Utf8String fullyQualifiedType(const Cursor &cursor) {
Utf8String prefix;
if (cursor.kind() == CXCursor_ClassTemplate || cursor.kind() == CXCursor_Namespace)
if (cursor.kind() == CXCursor_ClassTemplate || cursor.kind() == CXCursor_Namespace) {
if (cursor.unifiedSymbolResolution() == "c:@aN")
return Utf8String::fromUtf8("(anonymous)");
return qualificationPrefix(cursor) + cursor.displayName();
}
return cursor.type().canonical().spelling();
}