Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ Bug Fixes to AST Handling
and ``relatedalso`` comment commands.
- Clang now uses the location of the begin of the member expression for ``CallExpr``
involving deduced ``this``. (#GH116928)
- Fixed printout of AST that uses pack indexing expression. (#GH116486)

Miscellaneous Bug Fixes
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 4 additions & 1 deletion clang/lib/AST/StmtPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,10 @@ void StmtPrinter::VisitSizeOfPackExpr(SizeOfPackExpr *E) {
}

void StmtPrinter::VisitPackIndexingExpr(PackIndexingExpr *E) {
OS << E->getPackIdExpression() << "...[" << E->getIndexExpr() << "]";
PrintExpr(E->getPackIdExpression());
OS << "...[";
PrintExpr(E->getIndexExpr());
OS << "]";
}

void StmtPrinter::VisitSubstNonTypeTemplateParmPackExpr(
Expand Down
9 changes: 9 additions & 0 deletions clang/test/AST/ast-print-packindexingexpr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: %clang_cc1 -ast-print -std=c++2c %s | FileCheck %s

template <class... T, unsigned N>
auto foo(T ...params) {
return params...[N];
}

// CHECK: template <class ...T, unsigned int N> auto foo(T ...params) {
// CHECK-NEXT: return params...[N];