diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-14 02:55:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-14 02:55:32 +0000 |
commit | ada4b79947d7f38abd03b9c8ea5e194d48b4e730 (patch) | |
tree | a8c066a3ae13ca32c185fcf8f25a4be066c7e479 /clang/lib/Serialization/ASTWriter.cpp | |
parent | d4a5c05c97b8c70f062288116afdabcf4c532483 (diff) | |
download | bcm5719-llvm-ada4b79947d7f38abd03b9c8ea5e194d48b4e730.tar.gz bcm5719-llvm-ada4b79947d7f38abd03b9c8ea5e194d48b4e730.zip |
Start implementing support for substitution into pack expansions that
involve template parameter packs at multiple template levels that
occur within the signatures members of class templates (and partial
specializations thereof). This is a work-in-progress that is deficient
in several ways, notably:
- It only works for template type parameter packs, but we need to
also support non-type template parameter packs and template template
parameter packs.
- It doesn't keep track of the lengths of the substituted argument
packs in the expansion, so it can't properly diagnose length
mismatches.
However, this is a concrete step in the right direction.
llvm-svn: 123425
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index d3b103f56c1..52cf3829dc9 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -244,6 +244,14 @@ ASTTypeWriter::VisitSubstTemplateTypeParmType( } void +ASTTypeWriter::VisitSubstTemplateTypeParmPackType( + const SubstTemplateTypeParmPackType *T) { + Writer.AddTypeRef(QualType(T->getReplacedParameter(), 0), Record); + Writer.AddTemplateArgument(T->getArgumentPack(), Record); + Code = TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK; +} + +void ASTTypeWriter::VisitTemplateSpecializationType( const TemplateSpecializationType *T) { Record.push_back(T->isDependentType()); @@ -491,6 +499,10 @@ void TypeLocWriter::VisitSubstTemplateTypeParmTypeLoc( SubstTemplateTypeParmTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } +void TypeLocWriter::VisitSubstTemplateTypeParmPackTypeLoc( + SubstTemplateTypeParmPackTypeLoc TL) { + Writer.AddSourceLocation(TL.getNameLoc(), Record); +} void TypeLocWriter::VisitTemplateSpecializationTypeLoc( TemplateSpecializationTypeLoc TL) { Writer.AddSourceLocation(TL.getTemplateNameLoc(), Record); |