Skip to content

Commit 1ca0195

Browse files
authored
[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.
1 parent b47e439 commit 1ca0195

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/lib/AST/TypePrinter.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,10 +1213,13 @@ void TypePrinter::printDecltypeBefore(const DecltypeType *T, raw_ostream &OS) {
12131213

12141214
void TypePrinter::printPackIndexingBefore(const PackIndexingType *T,
12151215
raw_ostream &OS) {
1216-
if (T->hasSelectedType())
1216+
if (T->hasSelectedType()) {
12171217
OS << T->getSelectedType();
1218-
else
1219-
OS << T->getPattern() << "...[" << T->getIndexExpr() << "]";
1218+
} else {
1219+
OS << T->getPattern() << "...[";
1220+
T->getIndexExpr()->printPretty(OS, nullptr, Policy);
1221+
OS << "]";
1222+
}
12201223
spaceBeforePlaceHolder(OS);
12211224
}
12221225

0 commit comments

Comments
 (0)