From 6fc070116b0fafde83b4abbed00b69d5957116fc Mon Sep 17 00:00:00 2001 From: Elisavet Sakellari Date: Wed, 27 Jan 2016 10:52:16 +0100 Subject: [PATCH] Implemented Template Type Parameter import in ASTImporter class --- .../llvm/src/tools/clang/lib/AST/ASTImporter.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp index 2442e8ec25f12..b120d58fb2aa8 100644 --- a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp +++ b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp @@ -67,7 +67,7 @@ namespace clang { // FIXME: DependentDecltypeType QualType VisitRecordType(const RecordType *T); QualType VisitEnumType(const EnumType *T); - // FIXME: TemplateTypeParmType + QualType VisitTemplateTypeParmType(const TemplateTypeParmType *T); // FIXME: SubstTemplateTypeParmType QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T); QualType VisitElaboratedType(const ElaboratedType *T); @@ -1724,6 +1724,18 @@ QualType ASTNodeImporter::VisitEnumType(const EnumType *T) { return Importer.getToContext().getTagDeclType(ToDecl); } +QualType ASTNodeImporter::VisitTemplateTypeParmType(const TemplateTypeParmType *T) { + TemplateTypeParmDecl *ToDecl + = dyn_cast_or_null(Importer.Import(T->getDecl())); + if (!ToDecl) + return QualType(); + + return Importer.getToContext().getTemplateTypeParmType(T->getDepth(), + T->getIndex(), + T->isParameterPack(), + ToDecl); +} + QualType ASTNodeImporter::VisitTemplateSpecializationType( const TemplateSpecializationType *T) { TemplateName ToTemplate = Importer.Import(T->getTemplateName());