File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -724,6 +724,11 @@ std::string ToString(clang::QualType qual_type) {
724724 }
725725 }
726726
727+ if (auto *tag = qual_type->getAsTagDecl ();
728+ tag && !tag->getIdentifier () && !tag->getTypedefNameForAnonDecl ()) {
729+ return ToString (clang::cast<clang::NamedDecl>(tag));
730+ }
731+
727732 std::string type;
728733 llvm::raw_string_ostream os (type);
729734 normalizeQualType (qual_type).print (os, getPrintPolicy ());
@@ -738,7 +743,7 @@ std::string ToString(const clang::NamedDecl *decl) {
738743
739744 if (auto *enum_decl = clang::dyn_cast<clang::EnumDecl>(decl);
740745 enum_decl && !enum_decl->getIdentifier () &&
741- enum_decl->getTypedefNameForAnonDecl () == nullptr ) {
746+ ! enum_decl->getTypedefNameForAnonDecl ()) {
742747 return std::format (" anon_enum_{}" , GetLineNumber (enum_decl));
743748 }
744749
You can’t perform that action at this time.
0 commit comments