aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2025-04-01 21:11:56 -0300
committerGitHub <noreply@github.com>2025-04-01 21:11:56 -0300
commitad1ca5f4a2bc09f99fd82e5444f5da37c2985e97 (patch)
tree9d393f3b37d398a8c3bdcc52f68bbeed93773cfe /clang/lib/Serialization/ASTWriterDecl.cpp
parent2f25345670081f1ca460ea3f42a0585ef3f1e877 (diff)
downloadllvm-ad1ca5f4a2bc09f99fd82e5444f5da37c2985e97.zip
llvm-ad1ca5f4a2bc09f99fd82e5444f5da37c2985e97.tar.gz
llvm-ad1ca5f4a2bc09f99fd82e5444f5da37c2985e97.tar.bz2
[clang] Concepts: support pack expansions for type constraints (#132626)
This reverts an earlier attempt (adb0d8ddceb143749c519d14b8b31b481071da77 and 50e5411e4247421fd606f0a206682fcdf0303ae3) to support these expansions, which was limited to type arguments and which subverted the purpose of SubstTemplateTypeParmType. This propagates the ArgumentPackSubstitutionIndex along with the AssociatedConstraint, so that the pack expansion works, without needing any new transforms or otherwise any changes to the template instantiation process. This keeps the tests from the reverted commits, and adds a few more showing the new solution also works for NTTPs. Fixes https://github.com/llvm/llvm-project/issues/131798
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index f377c14..b896a04a0 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -2036,6 +2036,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
if (CR)
Record.AddConceptReference(CR);
Record.AddStmt(TC->getImmediatelyDeclaredConstraint());
+ Record.push_back(TC->getArgumentPackSubstitutionIndex());
Record.push_back(D->isExpandedParameterPack());
if (D->isExpandedParameterPack())
Record.push_back(D->getNumExpansionParameters());