diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2010-07-30 17:08:56 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2010-07-30 17:08:56 +0000 |
commit | 44dd0b440efdb37ff4c6e49f243faa3b0580b120 (patch) | |
tree | 839bd207e191e998df6538925fc6a5da833452f3 | |
parent | ade5000c8763f4bec41f452d7efa3a9b2a6d4712 (diff) |
Introduce RedeclarableTemplateDecl::SpecEntryTraits
SpecEntryTraits describes how to obtain the most recent declaration
of a specialisation from an entry in a specialisation FoldingSet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109868 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclTemplate.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index b26c569d5d..341c802f50 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -504,6 +504,14 @@ class RedeclarableTemplateDecl : public TemplateDecl { } protected: + template <typename EntryType> struct SpecEntryTraits { + typedef EntryType DeclType; + + static DeclType *getMostRecentDeclaration(EntryType *D) { + return D->getMostRecentDeclaration(); + } + }; + struct CommonBase { CommonBase() : InstantiatedFromMember(0, false) { } @@ -677,6 +685,16 @@ public: } }; +template <> struct RedeclarableTemplateDecl:: +SpecEntryTraits<FunctionTemplateSpecializationInfo> { + typedef FunctionDecl DeclType; + + static DeclType * + getMostRecentDeclaration(FunctionTemplateSpecializationInfo *I) { + return I->Function->getMostRecentDeclaration(); + } +}; + /// Declaration of a template function. class FunctionTemplateDecl : public RedeclarableTemplateDecl, public RedeclarableTemplate<FunctionTemplateDecl> { |