aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorantangelo <contact@antangelo.com>2025-01-27 18:59:12 -0500
committerGitHub <noreply@github.com>2025-01-27 18:59:12 -0500
commitf94c481543bdd3b11a668ad78d46593cf974788f (patch)
treec7a5011911380e9d4692400f7c863f3be73d43cf /clang/lib/Serialization/ASTWriterDecl.cpp
parenta34159f85ee01c197cc9d938bd1fc40c4c7dba51 (diff)
downloadllvm-f94c481543bdd3b11a668ad78d46593cf974788f.zip
llvm-f94c481543bdd3b11a668ad78d46593cf974788f.tar.gz
llvm-f94c481543bdd3b11a668ad78d46593cf974788f.tar.bz2
[clang] Track source deduction guide for alias template deduction guides (#123875)
For deduction guides generated from alias template CTAD, store the deduction guide they were originated from. The source kind is also maintained for future expansion in CTAD from inherited constructors. This tracking is required to determine whether an alias template already has a deduction guide corresponding to some deduction guide on the original template, in order to support deduction guides for the alias from deduction guides declared after the initial usage.
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 8b9ba04..fa2294d 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -846,6 +846,9 @@ void ASTDeclWriter::VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D) {
Record.AddDeclRef(D->Ctor);
VisitFunctionDecl(D);
Record.push_back(static_cast<unsigned char>(D->getDeductionCandidateKind()));
+ Record.AddDeclRef(D->getSourceDeductionGuide());
+ Record.push_back(
+ static_cast<unsigned char>(D->getSourceDeductionGuideKind()));
Code = serialization::DECL_CXX_DEDUCTION_GUIDE;
}