================ @@ -862,13 +881,21 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { } } -void DeclPrinter::VisitFriendDecl(FriendDecl *D) { +void DeclPrinter::VisitFriendDecl(FriendDecl *D, bool FirstInGroup) { if (TypeSourceInfo *TSI = D->getFriendType()) { unsigned NumTPLists = D->getFriendTypeNumTemplateParameterLists(); for (unsigned i = 0; i < NumTPLists; ++i) printTemplateParameters(D->getFriendTypeTemplateParameterList(i)); - Out << "friend "; - Out << " " << TSI->getType().getAsString(Policy); + + // Hack to print friend declarations declared as a group, e.g. + // 'friend int, long;', instead of printing them as two separate + // FriendDecls, which they are in the AST. + if (FirstInGroup) + Out << "friend "; + else + Out << ", "; + ---------------- cor3ntin wrote:
Can we use ListSeparator here? https://github.com/llvm/llvm-project/pull/101448 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits