/// for the common pointer.
CommonBase *getCommonPtr();
- virtual CommonBase *newCommon(ASTContext &C) = 0;
+ CommonBase *newCommon(ASTContext &C);
// Construct a template decl with name, parameters, and templated element.
RedeclarableTemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
}
friend class FunctionDecl;
-
+ friend class RedeclarableTemplateDecl;
+
/// \brief Retrieve the set of function template specializations of this
/// function template.
llvm::FoldingSet<FunctionTemplateSpecializationInfo> &getSpecializations() {
return static_cast<Common *>(RedeclarableTemplateDecl::getCommonPtr());
}
+ friend class RedeclarableTemplateDecl;
+
public:
/// Get the underlying class declarations of the template.
CXXRecordDecl *getTemplatedDecl() const {
}
+RedeclarableTemplateDecl::CommonBase *
+RedeclarableTemplateDecl::newCommon(ASTContext &C) {
+ if (FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(this))
+ return FunTmpl->newCommon(C);
+
+ return cast<ClassTemplateDecl>(this)->newCommon(C);
+}
+
RedeclarableTemplateDecl *RedeclarableTemplateDecl::getCanonicalDeclImpl() {
RedeclarableTemplateDecl *Tmpl = this;
while (Tmpl->getPreviousDeclaration())