From 62a61deb2547df29adfc293ff30ddef2f54abc6d Mon Sep 17 00:00:00 2001 From: CristinaCristescu Date: Fri, 22 Jul 2016 20:06:25 +0200 Subject: [PATCH] Missing function for IsStructurallyEquivalent for TemplateName Causes infinite recursion when importing tempated classes. --- .../llvm/src/tools/clang/lib/AST/ASTImporter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp index f33532ebe16dd..3b76bfc92c680 100644 --- a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp +++ b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp @@ -388,6 +388,17 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, return true; } +/// \brief Detrmine wheter two template names are the same +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, + const TemplateName &Name1, + const TemplateName &Name2) { + return Context.IsStructurallyEquivalent( + Name1.getAsTemplateDecl()->getCanonicalDecl(), + Name2.getAsTemplateDecl()->getCanonicalDecl()) + && (Name1.getAsTemplateDecl()->getNameAsString() + == Name2.getAsTemplateDecl()->getNameAsString()); +} + /// \brief Determine whether two template arguments are equivalent. static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, const TemplateArgument &Arg1,