//===--- SemaTemplateInstantiateExpr.cpp - C++ Template Expr 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 for expressions.////===----------------------------------------------------------------------===/#include"Sema.h"#include"clang/AST/ASTContext.h"#include"clang/AST/DeclTemplate.h"#include"clang/AST/StmtVisitor.h"#include"clang/AST/Expr.h"#include"clang/AST/ExprCXX.h"#include"clang/Parse/DeclSpec.h"#include"clang/Parse/Designator.h"#include"clang/Lex/Preprocessor.h" // for the identifier table#include"llvm/Support/Compiler.h"usingnamespaceclang;namespace{classVISIBILITY_HIDDENTemplateExprInstantiator:publicStmtVisitor<TemplateExprInstantiator,Sema::OwningExprResult>{Sema&SemaRef;constTemplateArgumentList&TemplateArgs;public:typedefSema::OwningExprResultOwningExprResult;TemplateExprInstantiator(Sema&SemaRef,constTemplateArgumentList&TemplateArgs):SemaRef(SemaRef),TemplateArgs(TemplateArgs){}// Declare VisitXXXStmt nodes for all of the expression kinds.#define EXPR(Type, Base) OwningExprResult Visit##Type(Type *S);#define STMT(Type, Base)#include"clang/AST/StmtNodes.def"// Base case. We can't get here.Sema::OwningExprResultVisitStmt(Stmt*S){S->dump();assert(false&&"Cannot instantiate this kind of expression");returnSemaRef.ExprError();}};}// Base case. We can't get here.Sema::OwningExprResultTemplateExprInstantiator::VisitExpr(Expr*E){E->dump();assert(false&&"Cannot instantiate this kind of expression");returnSemaRef.ExprError();}Sema::OwningExprResultTemplateExprInstantiator::VisitPredefinedExpr(PredefinedExpr*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitIntegerLiteral(IntegerLiteral*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitFloatingLiteral(FloatingLiteral*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitStringLiteral(StringLiteral*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitCharacterLiteral(CharacterLiteral*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitImaginaryLiteral(ImaginaryLiteral*E){returnSemaRef.Clone(E);}Sema::OwningExprResultTemplateExprInstantiator::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr*E){returnSemaRef.Clone(E);}Sema