diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-02 23:24:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-02 23:24:31 +0000 |
commit | 9dc8bd327f8ae80ea4366be6da910ed01ddc4468 (patch) | |
tree | 4c75abc7b8e24d7cad036b1c3c97edf3f74c48a3 /clang/lib/AST/DeclTemplate.cpp | |
parent | bbb772ace9f28aa1bde762722c7424549fdf6e51 (diff) | |
download | bcm5719-llvm-9dc8bd327f8ae80ea4366be6da910ed01ddc4468.tar.gz bcm5719-llvm-9dc8bd327f8ae80ea4366be6da910ed01ddc4468.zip |
Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.
llvm-svn: 77925
Diffstat (limited to 'clang/lib/AST/DeclTemplate.cpp')
-rw-r--r-- | clang/lib/AST/DeclTemplate.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp index 6b3ea437ab6..f5f7bfec5fa 100644 --- a/clang/lib/AST/DeclTemplate.cpp +++ b/clang/lib/AST/DeclTemplate.cpp @@ -415,6 +415,22 @@ ClassTemplateSpecializationDecl::Create(ASTContext &Context, return Result; } +void ClassTemplateSpecializationDecl::Destroy(ASTContext &C) { + if (SpecializedPartialSpecialization *PartialSpec + = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>()) + C.Deallocate(PartialSpec); + + CXXRecordDecl::Destroy(C); +} + +ClassTemplateDecl * +ClassTemplateSpecializationDecl::getSpecializedTemplate() const { + if (SpecializedPartialSpecialization *PartialSpec + = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>()) + return PartialSpec->PartialSpecialization->getSpecializedTemplate(); + return SpecializedTemplate.get<ClassTemplateDecl*>(); +} + //===----------------------------------------------------------------------===// // ClassTemplatePartialSpecializationDecl Implementation //===----------------------------------------------------------------------===// |