clang  6.0.0svn
Functions
SemaExprCXX.cpp File Reference

Implements semantic analysis for C++ expressions. More...

#include "clang/Sema/SemaInternal.h"
#include "TreeTransform.h"
#include "TypeLocBuilder.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/AlignedAllocation.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaLambda.h"
#include "clang/Sema/TemplateDeduction.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ErrorHandling.h"
Include dependency graph for SemaExprCXX.cpp:

Go to the source code of this file.

Functions

static void getUuidAttrOfType (Sema &SemaRef, QualType QT, llvm::SmallSetVector< const UuidAttr *, 1 > &UuidAttrs)
 Grabs __declspec(uuid()) off a type, or returns 0 if we cannot resolve to a single GUID. More...
 
static void collectPublicBases (CXXRecordDecl *RD, llvm::DenseMap< CXXRecordDecl *, unsigned > &SubobjectsSeen, llvm::SmallPtrSetImpl< CXXRecordDecl *> &VBases, llvm::SetVector< CXXRecordDecl *> &PublicSubobjectsSeen, bool ParentIsPublic)
 
static void getUnambiguousPublicSubobjects (CXXRecordDecl *RD, llvm::SmallVectorImpl< CXXRecordDecl *> &Objects)
 
static QualType adjustCVQualifiersForCXXThisWithinLambda (ArrayRef< FunctionScopeInfo *> FunctionScopes, QualType ThisTy, DeclContext *CurSemaContext, ASTContext &ASTCtx)
 
static ExprcaptureThis (Sema &S, ASTContext &Context, RecordDecl *RD, QualType ThisTy, SourceLocation Loc, const bool ByCopy)
 
static bool isNonPlacementDeallocationFunction (Sema &S, FunctionDecl *FD)
 Determine whether the given function is a non-placement deallocation function. More...
 
static bool hasNewExtendedAlignment (Sema &S, QualType AllocType)
 Determine whether a type has new-extended alignment. More...
 
static UsualDeallocFnInfo resolveDeallocationOverload (Sema &S, LookupResult &R, bool WantSize, bool WantAlign, llvm::SmallVectorImpl< UsualDeallocFnInfo > *BestFns=nullptr)
 Select the correct "usual" deallocation function to use from a selection of deallocation functions (either global or class-scope). More...
 
static bool doesUsualArrayDeleteWantSize (Sema &S, SourceLocation loc, QualType allocType)
 Determine whether a given type is a class for which 'delete[]' would call a member 'operator delete[]' with a 'size_t' parameter. More...
 
static bool isLegalArrayNewInitializer (CXXNewExpr::InitializationStyle Style, Expr *Init)
 
static void diagnoseUnavailableAlignedAllocation (const FunctionDecl &FD, SourceLocation Loc, bool IsDelete, Sema &S)
 
static bool resolveAllocationOverload (Sema &S, LookupResult &R, SourceRange Range, SmallVectorImpl< Expr *> &Args, bool &PassAlignment, FunctionDecl *&Operator, OverloadCandidateSet *AlignedCandidates=nullptr, Expr *AlignArg=nullptr)
 
static void DiagnoseMismatchedNewDelete (Sema &SemaRef, SourceLocation DeleteLoc, const MismatchingNewDeleteDetector &Detector)
 
static ExprResult BuildCXXCastArgument (Sema &S, SourceLocation CastLoc, QualType Ty, CastKind Kind, CXXMethodDecl *Method, DeclAccessPair FoundDecl, bool HadMultipleCandidates, Expr *From)
 
static bool CheckUnaryTypeTraitTypeCompleteness (Sema &S, TypeTrait UTT, SourceLocation Loc, QualType ArgTy)
 Check the completeness of a type in a unary type trait. More...
 
static bool HasNoThrowOperator (const RecordType *RT, OverloadedOperatorKind Op, Sema &Self, SourceLocation KeyLoc, ASTContext &C, bool(CXXRecordDecl::*HasTrivial)() const, bool(CXXRecordDecl::*HasNonTrivial)() const, bool(CXXMethodDecl::*IsDesiredOp)() const)
 
static bool EvaluateUnaryTypeTrait (Sema &Self, TypeTrait UTT, SourceLocation KeyLoc, QualType T)
 
static bool EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, QualType LhsT, QualType RhsT, SourceLocation KeyLoc)
 
static bool evaluateTypeTrait (Sema &S, TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo *> Args, SourceLocation RParenLoc)
 
static uint64_t EvaluateArrayTypeTrait (Sema &Self, ArrayTypeTrait ATT, QualType T, Expr *DimExpr, SourceLocation KeyLoc)
 
static bool EvaluateExpressionTrait (ExpressionTrait ET, Expr *E)
 
static bool TryClassUnification (Sema &Self, Expr *From, Expr *To, SourceLocation QuestionLoc, bool &HaveConversion, QualType &ToType)
 Try to convert a type to another according to C++11 5.16p3. More...
 
static bool FindConditionalOverload (Sema &Self, ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc)
 Try to find a common type for two according to C++0x 5.16p5. More...
 
static bool ConvertForConditional (Sema &Self, ExprResult &E, QualType T)
 Perform an "extended" implicit conversion as returned by TryClassUnification. More...
 
static FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs (Sema &S, FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage)
 
static void noteOperatorArrows (Sema &S, ArrayRef< FunctionDecl *> OperatorArrows)
 Note a set of 'operator->' functions that were used for a member access. More...
 
static bool CheckArrow (Sema &S, QualType &ObjectType, Expr *&Base, tok::TokenKind &OpKind, SourceLocation OpLoc)
 
static bool canRecoverDotPseudoDestructorCallsOnPointerObjects (Sema &SemaRef, QualType DestructedType)
 Check if it's ok to try and recover dot pseudo destructor calls on pointer objects. More...
 
static bool IsSpecialDiscardedValue (Expr *E)
 
static bool VariableCanNeverBeAConstantExpression (VarDecl *Var, ASTContext &Context)
 
static void CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures (Expr *const FE, LambdaScopeInfo *const CurrentLSI, Sema &S)
 Check if the current lambda has any potential captures that must be captured by any of its enclosing lambdas that are ready to capture. More...
 
static ExprResult attemptRecovery (Sema &SemaRef, const TypoCorrectionConsumer &Consumer, const TypoCorrection &TC)
 

Detailed Description

Implements semantic analysis for C++ expressions.

Definition in file SemaExprCXX.cpp.

Function Documentation

◆ adjustCVQualifiersForCXXThisWithinLambda()

static QualType adjustCVQualifiersForCXXThisWithinLambda ( ArrayRef< FunctionScopeInfo *>  FunctionScopes,
QualType  ThisTy,
DeclContext CurSemaContext,
ASTContext ASTCtx 
)
static

Definition at line 890 of file SemaExprCXX.cpp.

References clang::Type::getPointeeType().

◆ attemptRecovery()

static ExprResult attemptRecovery ( Sema SemaRef,
const TypoCorrectionConsumer Consumer,
const TypoCorrection TC 
)
static

◆ BuildCXXCastArgument()

static ExprResult BuildCXXCastArgument ( Sema S,
SourceLocation  CastLoc,
QualType  Ty,
CastKind  Kind,
CXXMethodDecl Method,
DeclAccessPair  FoundDecl,
bool  HadMultipleCandidates,
Expr From 
)
static

Definition at line 3465 of file SemaExprCXX.cpp.

◆ canRecoverDotPseudoDestructorCallsOnPointerObjects()

static bool canRecoverDotPseudoDestructorCallsOnPointerObjects ( Sema SemaRef,
QualType  DestructedType 
)
static

Check if it's ok to try and recover dot pseudo destructor calls on pointer objects.

Definition at line 6560 of file SemaExprCXX.cpp.

References clang::Sema::CanUseDecl(), clang::Type::getAsCXXRecordDecl(), clang::Type::isDependentType(), clang::Type::isScalarType(), clang::Type::isVectorType(), and clang::Sema::LookupDestructor().

Referenced by clang::Sema::BuildPseudoDestructorExpr().

◆ captureThis()

static Expr* captureThis ( Sema S,
ASTContext Context,
RecordDecl RD,
QualType  ThisTy,
SourceLocation  Loc,
const bool  ByCopy 
)
static

◆ CheckArrow()

static bool CheckArrow ( Sema S,
QualType ObjectType,
Expr *&  Base,
tok::TokenKind OpKind,
SourceLocation  OpLoc 
)
static

◆ CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures()

static void CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures ( Expr *const  FE,
LambdaScopeInfo *const  CurrentLSI,
Sema S 
)
static

Check if the current lambda has any potential captures that must be captured by any of its enclosing lambdas that are ready to capture.

If there is a lambda that can capture a nested potential-capture, go ahead and do so. Also, check to see if any variables are uncaptureable or do not involve an odr-use so do not need to be captured.

Definition at line 7115 of file SemaExprCXX.cpp.

References clang::sema::LambdaScopeInfo::CallOperator, clang::Sema::CurContext, clang::Sema::FunctionScopes, clang::sema::LambdaScopeInfo::getNumPotentialVariableCaptures(), clang::DeclContext::getParent(), clang::DeclContext::isDependentContext(), clang::Expr::isInstantiationDependent(), and clang::Sema::isUnevaluatedContext().

Referenced by clang::Sema::ActOnFinishFullExpr().

◆ CheckUnaryTypeTraitTypeCompleteness()

static bool CheckUnaryTypeTraitTypeCompleteness ( Sema S,
TypeTrait  UTT,
SourceLocation  Loc,
QualType  ArgTy 
)
static

Check the completeness of a type in a unary type trait.

If the particular type trait requires a complete type, tries to complete it. If completing the type fails, a diagnostic is emitted and false returned. If completing the type succeeds or no completion was required, returns true.

Definition at line 4070 of file SemaExprCXX.cpp.

References clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::Type::isIncompleteArrayType(), clang::Type::isVoidType(), clang::Sema::RequireCompleteType(), clang::UTT_HasNothrowAssign, clang::UTT_HasNothrowConstructor, clang::UTT_HasNothrowCopy, clang::UTT_HasNothrowMoveAssign, clang::UTT_HasTrivialAssign, clang::UTT_HasTrivialCopy, clang::UTT_HasTrivialDefaultConstructor, clang::UTT_HasTrivialDestructor, clang::UTT_HasTrivialMoveAssign, clang::UTT_HasTrivialMoveConstructor, clang::UTT_HasVirtualDestructor, clang::UTT_IsAbstract, clang::UTT_IsAggregate, clang::UTT_IsArithmetic, clang::UTT_IsArray, clang::UTT_IsClass, clang::UTT_IsCompleteType, clang::UTT_IsCompound, clang::UTT_IsConst, clang::UTT_IsDestructible, clang::UTT_IsEmpty, clang::UTT_IsEnum, clang::UTT_IsFinal, clang::UTT_IsFloatingPoint, clang::UTT_IsFunction, clang::UTT_IsFundamental, clang::UTT_IsIntegral, clang::UTT_IsInterfaceClass, clang::UTT_IsLiteral, clang::UTT_IsLvalueReference, clang::UTT_IsMemberFunctionPointer, clang::UTT_IsMemberObjectPointer, clang::UTT_IsMemberPointer, clang::UTT_IsNothrowDestructible, clang::UTT_IsObject, clang::UTT_IsPOD, clang::UTT_IsPointer, clang::UTT_IsPolymorphic, clang::UTT_IsReference, clang::UTT_IsRvalueReference, clang::UTT_IsScalar, clang::UTT_IsSealed, clang::UTT_IsSigned, clang::UTT_IsStandardLayout, clang::UTT_IsTrivial, clang::UTT_IsTriviallyCopyable, clang::UTT_IsTriviallyDestructible, clang::UTT_IsUnion, clang::UTT_IsUnsigned, clang::UTT_IsVoid, and clang::UTT_IsVolatile.

Referenced by clang::Sema::BuildTypeTrait().

◆ collectPublicBases()

static void collectPublicBases ( CXXRecordDecl RD,
llvm::DenseMap< CXXRecordDecl *, unsigned > &  SubobjectsSeen,
llvm::SmallPtrSetImpl< CXXRecordDecl *> &  VBases,
llvm::SetVector< CXXRecordDecl *> &  PublicSubobjectsSeen,
bool  ParentIsPublic 
)
static

Definition at line 748 of file SemaExprCXX.cpp.

References clang::AS_public, and clang::CXXRecordDecl::bases().

Referenced by getUnambiguousPublicSubobjects().

◆ ConvertForConditional()

static bool ConvertForConditional ( Sema Self,
ExprResult E,
QualType  T 
)
static

◆ DiagnoseMismatchedNewDelete()

static void DiagnoseMismatchedNewDelete ( Sema SemaRef,
SourceLocation  DeleteLoc,
const MismatchingNewDeleteDetector &  Detector 
)
static

◆ diagnoseUnavailableAlignedAllocation()

static void diagnoseUnavailableAlignedAllocation ( const FunctionDecl FD,
SourceLocation  Loc,
bool  IsDelete,
Sema S 
)
static

◆ doesUsualArrayDeleteWantSize()

static bool doesUsualArrayDeleteWantSize ( Sema S,
SourceLocation  loc,
QualType  allocType 
)
static

Determine whether a given type is a class for which 'delete[]' would call a member 'operator delete[]' with a 'size_t' parameter.

This implies that we need to store the array size (even if the type is trivially-destructible).

Definition at line 1514 of file SemaExprCXX.cpp.

References clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::LookupResult::empty(), clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::DeclarationNameTable::getCXXOperatorName(), clang::RecordType::getDecl(), hasNewExtendedAlignment(), clang::LookupResult::isAmbiguous(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), resolveDeallocationOverload(), and clang::LookupResult::suppressDiagnostics().

Referenced by clang::Sema::ActOnCXXDelete().

◆ EvaluateArrayTypeTrait()

static uint64_t EvaluateArrayTypeTrait ( Sema Self,
ArrayTypeTrait  ATT,
QualType  T,
Expr DimExpr,
SourceLocation  KeyLoc 
)
static

◆ EvaluateBinaryTypeTrait()

static bool EvaluateBinaryTypeTrait ( Sema Self,
TypeTrait  BTT,
QualType  LhsT,
QualType  RhsT,
SourceLocation  KeyLoc 
)
static

Definition at line 4776 of file SemaExprCXX.cpp.

References clang::BTT_IsAssignable, clang::BTT_IsBaseOf, clang::BTT_IsConvertible, clang::BTT_IsConvertibleTo, clang::BTT_IsNothrowAssignable, clang::BTT_IsSame, clang::BTT_IsTriviallyAssignable, clang::BTT_TypeCompatible, clang::Sema::BuildBinOp(), clang::Sema::canThrow(), clang::Sema::Context, clang::InitializationKind::CreateCopy(), clang::CT_Cannot, clang::Type::getAs(), clang::Sema::getASTContext(), clang::RecordType::getDecl(), clang::ObjCObjectType::getInterface(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getUnqualifiedArrayType(), clang::Expr::getValueKindForType(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::QualType::hasNonTrivialObjCLifetime(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::InitializedEntity::InitializeTemporary(), clang::Sema::isAbstractType(), clang::Type::isArrayType(), clang::Sema::isCompleteType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isObjectType(), clang::ObjCInterfaceDecl::isSuperClassOf(), clang::TagDecl::isUnion(), clang::Type::isVoidType(), clang::Sema::RequireCompleteType(), clang::Result, clang::ASTContext::typesAreCompatible(), and clang::Sema::Unevaluated.

Referenced by evaluateTypeTrait().

◆ EvaluateExpressionTrait()

static bool EvaluateExpressionTrait ( ExpressionTrait  ET,
Expr E 
)
static

◆ evaluateTypeTrait()

static bool evaluateTypeTrait ( Sema S,
TypeTrait  Kind,
SourceLocation  KWLoc,
ArrayRef< TypeSourceInfo *>  Args,
SourceLocation  RParenLoc 
)
static

◆ EvaluateUnaryTypeTrait()

static bool EvaluateUnaryTypeTrait ( Sema Self,
TypeTrait  UTT,
SourceLocation  KeyLoc,
QualType  T 
)
static

Definition at line 4222 of file SemaExprCXX.cpp.

References clang::AS_public, clang::Sema::Context, clang::Decl::getAccess(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::QualType::getObjCLifetime(), clang::ValueDecl::getType(), clang::CXXRecordDecl::hasNonTrivialCopyAssignment(), clang::CXXRecordDecl::hasNonTrivialMoveAssignment(), HasNoThrowOperator(), clang::CXXRecordDecl::hasTrivialCopyAssignment(), clang::CXXRecordDecl::hasTrivialMoveAssignment(), clang::Type::isAggregateType(), clang::Type::isAnyComplexType(), clang::Type::isArithmeticType(), clang::Type::isArrayType(), clang::Type::isClassType(), clang::Type::isCompoundType(), clang::QualType::isConstQualified(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::FunctionDecl::isDeleted(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isEnumeralType(), clang::Type::isExtVectorType(), clang::Type::isFloatingType(), clang::Type::isFunctionType(), clang::Type::isFundamentalType(), clang::Type::isIncompleteType(), clang::Type::isIntegralType(), clang::Type::isInterfaceType(), clang::Type::isLiteralType(), clang::Type::isLValueReferenceType(), clang::Type::isMemberDataPointerType(), clang::Type::isMemberFunctionPointerType(), clang::Type::isMemberPointerType(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::FunctionProtoType::isNothrow(), clang::Type::isObjCLifetimeType(), clang::Type::isObjectType(), clang::QualType::isPODType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Type::isScalarType(), clang::Type::isSignedIntegerType(), clang::Type::isStandardLayoutType(), clang::Type::isStructureType(), clang::QualType::isTriviallyCopyableType(), clang::QualType::isTrivialType(), clang::Type::isUnionType(), clang::Type::isUnsignedIntegerType(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::Sema::LookupDestructor(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::Sema::ResolveExceptionSpec(), clang::UTT_HasNothrowAssign, clang::UTT_HasNothrowCopy, clang::UTT_HasNothrowMoveAssign, clang::UTT_HasTrivialAssign, clang::UTT_HasTrivialCopy, clang::UTT_HasTrivialDefaultConstructor, clang::UTT_HasTrivialDestructor, clang::UTT_HasTrivialMoveAssign, clang::UTT_HasTrivialMoveConstructor, clang::UTT_IsAbstract, clang::UTT_IsAggregate, clang::UTT_IsArithmetic, clang::UTT_IsArray, clang::UTT_IsClass, clang::UTT_IsCompound, clang::UTT_IsConst, clang::UTT_IsDestructible, clang::UTT_IsEmpty, clang::UTT_IsEnum, clang::UTT_IsFinal, clang::UTT_IsFloatingPoint, clang::UTT_IsFunction, clang::UTT_IsFundamental, clang::UTT_IsIntegral, clang::UTT_IsInterfaceClass, clang::UTT_IsLiteral, clang::UTT_IsLvalueReference, clang::UTT_IsMemberFunctionPointer, clang::UTT_IsMemberObjectPointer, clang::UTT_IsMemberPointer, clang::UTT_IsNothrowDestructible, clang::UTT_IsObject, clang::UTT_IsPOD, clang::UTT_IsPointer, clang::UTT_IsPolymorphic, clang::UTT_IsReference, clang::UTT_IsRvalueReference, clang::UTT_IsScalar, clang::UTT_IsSealed, clang::UTT_IsSigned, clang::UTT_IsStandardLayout, clang::UTT_IsTrivial, clang::UTT_IsTriviallyCopyable, clang::UTT_IsTriviallyDestructible, clang::UTT_IsUnion, clang::UTT_IsUnsigned, clang::UTT_IsVoid, and clang::UTT_IsVolatile.

Referenced by evaluateTypeTrait().

◆ FindConditionalOverload()

static bool FindConditionalOverload ( Sema Self,
ExprResult LHS,
ExprResult RHS,
SourceLocation  QuestionLoc 
)
static

◆ getUnambiguousPublicSubobjects()

static void getUnambiguousPublicSubobjects ( CXXRecordDecl RD,
llvm::SmallVectorImpl< CXXRecordDecl *> &  Objects 
)
static

Definition at line 777 of file SemaExprCXX.cpp.

References collectPublicBases().

◆ getUuidAttrOfType()

static void getUuidAttrOfType ( Sema SemaRef,
QualType  QT,
llvm::SmallSetVector< const UuidAttr *, 1 > &  UuidAttrs 
)
static

◆ hasNewExtendedAlignment()

static bool hasNewExtendedAlignment ( Sema S,
QualType  AllocType 
)
static

Determine whether a type has new-extended alignment.

This may be called when the type is incomplete (for a delete-expression with an incomplete pointee type), in which case it will conservatively return false if the alignment is not known.

Definition at line 1468 of file SemaExprCXX.cpp.

References clang::Sema::getASTContext(), clang::Sema::getLangOpts(), clang::TargetInfo::getNewAlign(), clang::ASTContext::getTargetInfo(), and clang::ASTContext::getTypeAlignIfKnown().

Referenced by clang::Sema::ActOnCXXDelete(), and doesUsualArrayDeleteWantSize().

◆ HasNoThrowOperator()

static bool HasNoThrowOperator ( const RecordType RT,
OverloadedOperatorKind  Op,
Sema Self,
SourceLocation  KeyLoc,
ASTContext C,
bool(CXXRecordDecl::*)() const  HasTrivial,
bool(CXXRecordDecl::*)() const  HasNonTrivial,
bool(CXXMethodDecl::*)() const  IsDesiredOp 
)
static

Definition at line 4186 of file SemaExprCXX.cpp.

References clang::RecordType::getDecl().

Referenced by EvaluateUnaryTypeTrait().

◆ isLegalArrayNewInitializer()

static bool isLegalArrayNewInitializer ( CXXNewExpr::InitializationStyle  Style,
Expr Init 
)
static

Definition at line 1640 of file SemaExprCXX.cpp.

References clang::CXXNewExpr::ListInit.

◆ isNonPlacementDeallocationFunction()

static bool isNonPlacementDeallocationFunction ( Sema S,
FunctionDecl FD 
)
static

◆ IsSpecialDiscardedValue()

static bool IsSpecialDiscardedValue ( Expr E)
static

Definition at line 6948 of file SemaExprCXX.cpp.

References clang::Expr::IgnoreParens().

◆ mergeExceptionSpecs()

static FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs ( Sema S,
FunctionProtoType::ExceptionSpecInfo  ESI1,
FunctionProtoType::ExceptionSpecInfo  ESI2,
SmallVectorImpl< QualType > &  ExceptionTypeStorage 
)
static

◆ noteOperatorArrows()

static void noteOperatorArrows ( Sema S,
ArrayRef< FunctionDecl *>  OperatorArrows 
)
static

Note a set of 'operator->' functions that were used for a member access.

Definition at line 6356 of file SemaExprCXX.cpp.

Referenced by clang::Sema::ActOnStartCXXMemberReference().

◆ resolveAllocationOverload()

static bool resolveAllocationOverload ( Sema S,
LookupResult R,
SourceRange  Range,
SmallVectorImpl< Expr *> &  Args,
bool PassAlignment,
FunctionDecl *&  Operator,
OverloadCandidateSet AlignedCandidates = nullptr,
Expr AlignArg = nullptr 
)
static

◆ resolveDeallocationOverload()

static UsualDeallocFnInfo resolveDeallocationOverload ( Sema S,
LookupResult R,
bool  WantSize,
bool  WantAlign,
llvm::SmallVectorImpl< UsualDeallocFnInfo > *  BestFns = nullptr 
)
static

Select the correct "usual" deallocation function to use from a selection of deallocation functions (either global or class-scope).

Definition at line 1476 of file SemaExprCXX.cpp.

Referenced by doesUsualArrayDeleteWantSize().

◆ TryClassUnification()

static bool TryClassUnification ( Sema Self,
Expr From,
Expr To,
SourceLocation  QuestionLoc,
bool HaveConversion,
QualType ToType 
)
static

Try to convert a type to another according to C++11 5.16p3.

This is part of the parameter validation for the ? operator. If either value operand is a class type, the two operands are attempted to be converted to each other. This function does the conversion in one direction. It returns true if the program is ill-formed and has already been diagnosed as such.

Definition at line 5260 of file SemaExprCXX.cpp.

References clang::Sema::Context, clang::InitializationKind::CreateCopy(), clang::InitializationSequence::Diagnose(), clang::InitializationSequence::Failed(), clang::Type::getAs(), clang::Stmt::getLocStart(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getNonLValueExprType(), clang::ASTContext::getRValueReferenceType(), clang::Expr::getType(), clang::InitializedEntity::InitializeTemporary(), clang::InitializationSequence::isAmbiguous(), clang::QualType::isAtLeastAsQualifiedAs(), clang::Sema::IsDerivedFrom(), clang::InitializationSequence::isDirectReferenceBinding(), clang::Expr::isLValue(), clang::Expr::isXValue(), and clang::T.

Referenced by clang::Sema::CXXCheckConditionalOperands().

◆ VariableCanNeverBeAConstantExpression()

static bool VariableCanNeverBeAConstantExpression ( VarDecl Var,
ASTContext Context 
)
inlinestatic