//===------- SemaTemplateInstantiate.cpp - C++ Template Instantiation ------===///// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.//===----------------------------------------------------------------------===///// This file implements C++ template instantiation.////===----------------------------------------------------------------------===/#include"Sema.h"#include"TreeTransform.h"#include"Lookup.h"#include"clang/AST/ASTConsumer.h"#include"clang/AST/ASTContext.h"#include"clang/AST/Expr.h"#include"clang/AST/DeclTemplate.h"#include"clang/Parse/DeclSpec.h"#include"clang/Basic/LangOptions.h"#include"llvm/Support/Compiler.h"usingnamespaceclang;//===----------------------------------------------------------------------===/// Template Instantiation Support//===----------------------------------------------------------------------===//// \brief Retrieve the template argument list(s) that should be used to/// instantiate the definition of the given declaration.////// \param D the declaration for which we are computing template instantiation/// arguments.////// \param Innermost if non-NULL, the innermost template argument list.MultiLevelTemplateArgumentListSema::getTemplateInstantiationArgs(NamedDecl*D,constTemplateArgumentList*Innermost){// Accumulate the set of template argument lists in this structure.MultiLevelTemplateArgumentListResult;if(Innermost)Result.addOuterTemplateArguments(Innermost);DeclContext*Ctx=dyn_cast<DeclContext>(D);if(!Ctx)Ctx=D->getDeclContext();while(!Ctx