Author: Krystian Stasiowski Date: 2024-04-10T08:41:22-04:00 New Revision: 1ca01958310f2956abd72ece1652c3218bcf27e1
URL: https://github.com/llvm/llvm-project/commit/1ca01958310f2956abd72ece1652c3218bcf27e1 DIFF: https://github.com/llvm/llvm-project/commit/1ca01958310f2956abd72ece1652c3218bcf27e1.diff LOG: [Clang][AST][NFC] Fix printing of dependent PackIndexTypes (#88146) Dependent `PackIndexType`s currently print the memory address of the index `Expr*` rather than pretty printing the expression. This patch fixes that. Added: Modified: clang/lib/AST/TypePrinter.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 075c8aba11fcb9..9602f448e94279 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1213,10 +1213,13 @@ void TypePrinter::printDecltypeBefore(const DecltypeType *T, raw_ostream &OS) { void TypePrinter::printPackIndexingBefore(const PackIndexingType *T, raw_ostream &OS) { - if (T->hasSelectedType()) + if (T->hasSelectedType()) { OS << T->getSelectedType(); - else - OS << T->getPattern() << "...[" << T->getIndexExpr() << "]"; + } else { + OS << T->getPattern() << "...["; + T->getIndexExpr()->printPretty(OS, nullptr, Policy); + OS << "]"; + } spaceBeforePlaceHolder(OS); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits