[clang] [Clang][TypePrinter] Make printNestedNameSpecifier look at typedefs (PR #169364)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 24 09:30:25 PST 2025


================
@@ -1790,7 +1790,9 @@ void NamedDecl::printNestedNameSpecifier(raw_ostream &OS,
       else
         OS << *ND;
     } else if (const auto *RD = dyn_cast<RecordDecl>(DC)) {
-      if (!RD->getIdentifier())
+      if (TypedefNameDecl *Typedef = RD->getTypedefNameForAnonDecl())
+        OS << Typedef->getIdentifier()->getName();
----------------
mizvekov wrote:

This should be equivalent to:
```suggestion
      if (TypedefNameDecl *TD = RD->getTypedefNameForAnonDecl())
        OS << *TD;
```

https://github.com/llvm/llvm-project/pull/169364


More information about the cfe-commits mailing list