diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1635,8 +1635,8 @@ llvm_unreachable("unknown module kind"); } -void NamedDecl::printName(raw_ostream &OS, const PrintingPolicy&) const { - OS << Name; +void NamedDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const { + Name.print(OS, Policy); } void NamedDecl::printName(raw_ostream &OS) const { diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp --- a/clang/lib/AST/DeclarationName.cpp +++ b/clang/lib/AST/DeclarationName.cpp @@ -117,12 +117,12 @@ Policy.adjustForCPlusPlus(); if (const RecordType *ClassRec = ClassType->getAs()) { - OS << *ClassRec->getDecl(); + ClassRec->getDecl()->printName(OS, Policy); return; } if (Policy.SuppressTemplateArgsInCXXConstructors) { if (auto *InjTy = ClassType->getAs()) { - OS << *InjTy->getDecl(); + InjTy->getDecl()->printName(OS, Policy); return; } }