diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp index 41edd431dd5b8b..129114ebfaedc0 100644 --- a/clang/lib/Index/USRGeneration.cpp +++ b/clang/lib/Index/USRGeneration.cpp @@ -549,22 +549,22 @@ void USRGenerator::VisitTagDecl(const TagDecl *D) { if (const TypedefNameDecl *TD = D->getTypedefNameForAnonDecl()) { Buf[off] = 'A'; Out << '@' << *TD; - } - else { - if (D->isEmbeddedInDeclarator() && !D->isFreeStanding()) { - printLoc(Out, D->getLocation(), Context->getSourceManager(), true); } else { - Buf[off] = 'a'; - if (auto *ED = dyn_cast(D)) { - // Distinguish USRs of anonymous enums by using their first enumerator. - auto enum_range = ED->enumerators(); - if (enum_range.begin() != enum_range.end()) { - Out << '@' << **enum_range.begin(); + if (D->isEmbeddedInDeclarator() && !D->isFreeStanding()) { + printLoc(Out, D->getLocation(), Context->getSourceManager(), true); + } else { + Buf[off] = 'a'; + if (auto *ED = dyn_cast(D)) { + // Distinguish USRs of anonymous enums by using their first + // enumerator. + auto enum_range = ED->enumerators(); + if (enum_range.begin() != enum_range.end()) { + Out << '@' << **enum_range.begin(); + } } } } } - } // For a class template specialization, mangle the template arguments. if (const ClassTemplateSpecializationDecl *Spec