diff options
-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> { |