//===--- ExprCXX.cpp - (C++) Expression AST Node Implementation -----------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the subclesses of Expr class declared in ExprCXX.h////===----------------------------------------------------------------------===//#include"clang/AST/ASTContext.h"#include"clang/AST/Attr.h"#include"clang/AST/DeclCXX.h"#include"clang/AST/DeclTemplate.h"#include"clang/AST/ExprCXX.h"#include"clang/AST/TypeLoc.h"#include"clang/Basic/IdentifierTable.h"usingnamespaceclang;//===----------------------------------------------------------------------===//// Child Iterators for iterating over subexpressions/substatements//===----------------------------------------------------------------------===//boolCXXTypeidExpr::isPotentiallyEvaluated()const{if(isTypeOperand())returnfalse;// C++11 [expr.typeid]p3:// When typeid is applied to an expression other than a glvalue of// polymorphic class type, [...] the expression is an unevaluated operand.constExpr*E=getExprOperand();if(constCXXRecordDecl*RD=E->getType()->getAsCXXRecordDecl())if(RD->isPolymorphic()&&E->isGLValue())returntrue;returnfalse;}QualTypeCXXTypeidExpr::getTypeOperand()const{assert(isTypeOperand()&&"Cannot call getTypeOperand for typeid(expr)");returnOperand.get<TypeSourceInfo*>()->getType().getNonReferenceType().getUnqualifiedType();}QualTypeCXXUuidofExpr::getTypeOperand()const{assert(isTypeOperand()&&"Cannot call getTypeOperand for __uuidof(expr)");returnOperand.get<TypeSourceInfo*>()->getType().getNonReferenceType().getUnqualifiedType();}// staticUuidAttr*CXXUuidofExpr::GetUuidAttrOfType(QualTypeQT){// Optionally remove one level of pointer, reference or array indirection.constType*Ty=QT.getTypePtr();if(QT->isPointerType()||QT