Lines Matching full:entity
196 static bool initializingConstexprVariable(const InitializedEntity &Entity) {
197 Decl *D = Entity.getDecl();
198 const InitializedEntity *Parent = &Entity;
280 /// handle the initialization of a certain kind of entity, e.g.,
326 void CheckImplicitInitList(const InitializedEntity &Entity,
330 void CheckExplicitInitList(const InitializedEntity &Entity,
334 void CheckListElementTypes(const InitializedEntity &Entity,
341 void CheckSubElementType(const InitializedEntity &Entity,
347 void CheckComplexType(const InitializedEntity &Entity,
352 void CheckScalarType(const InitializedEntity &Entity,
357 void CheckReferenceType(const InitializedEntity &Entity,
362 void CheckVectorType(const InitializedEntity &Entity,
366 void CheckStructUnionTypes(const InitializedEntity &Entity,
374 void CheckArrayType(const InitializedEntity &Entity,
380 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
408 const InitializedEntity &Entity);
497 void FillInEmptyInitializations(const InitializedEntity &Entity,
501 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
504 void CheckEmptyInitializable(const InitializedEntity &Entity,
507 Expr *HandleEmbed(EmbedExpr *Embed, const InitializedEntity &Entity) {
517 if (Entity.getKind() == InitializedEntity::EK_ArrayElement) {
519 SemaRef.Context.getAsArrayType(Entity.getParent()->getType());
545 Sema &S, const InitializedEntity &Entity, InitListExpr *IL, QualType &T,
549 InitListChecker(Sema &S, const InitializedEntity &Entity, InitListExpr *IL,
552 : InitListChecker(S, Entity, IL, T, /*VerifyOnly=*/true,
567 const InitializedEntity &Entity) {
579 Entity.getType()->getBaseElementTypeUnsafe()->isRecordType();
603 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit);
637 SemaRef, Entity,
646 if (Entity.getKind() == InitializedEntity::EK_Member)
647 SemaRef.Diag(Entity.getDecl()->getLocation(),
649 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement)
657 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit);
658 if (Entity.getKind() == InitializedEntity::EK_Member)
659 SemaRef.Diag(Entity.getDecl()->getLocation(),
661 << /*field*/1 << Entity.getDecl();
662 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) {
664 Entity.getParent() &&
665 Entity.getParent()->isVariableLengthArrayNew();
668 << Entity.getElementIndex();
676 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit);
679 void InitListChecker::CheckEmptyInitializable(const InitializedEntity &Entity,
686 PerformEmptyInit(Loc, Entity);
819 InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity,
857 FillInEmptyInitForField(0, ILE->getInitializedFieldInUnion(), Entity, ILE,
879 FillInEmptyInitForBase(Init, Base, Entity, ILE, RequiresSecondPass,
892 FillInEmptyInitForField(Init, Field, Entity, ILE, RequiresSecondPass,
910 InitializedEntity ElementEntity = Entity;
919 if (Entity.isVariableLengthArrayNew())
922 0, Entity);
927 0, Entity);
1016 Sema &S, const InitializedEntity &Entity, InitListExpr *IL, QualType &T,
1033 CheckExplicitInitList(Entity, IL, T, FullyStructuredList,
1038 FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass,
1041 FillInEmptyInitializations(Entity, FullyStructuredList,
1080 /// Determine whether Entity is an entity for which it is idiomatic to elide
1082 static bool isIdiomaticBraceElisionEntity(const InitializedEntity &Entity) {
1091 if (!Entity.getParent())
1095 if (Entity.getKind() == InitializedEntity::EK_Base) {
1097 Entity.getParent()->getType()->castAs<RecordType>()->getDecl();
1103 if (Entity.getKind() == InitializedEntity::EK_Member) {
1105 Entity.getParent()->getType()->castAs<RecordType>()->getDecl();
1126 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity,
1160 CheckListElementTypes(Entity, ParentIList, T,
1181 !isIdiomaticBraceElisionEntity(Entity)) {
1203 /// Warn that \p Entity was of scalar type and was initialized by a
1205 static void warnBracedScalarInit(Sema &S, const InitializedEntity &Entity,
1215 switch (Entity.getKind()) {
1231 if (Entity.getParent())
1263 << Entity.getType()->isSizelessBuiltinType() << Braces
1274 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity,
1279 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true,
1332 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange());
1355 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity,
1366 CheckComplexType(Entity, IList, DeclType, Index,
1369 CheckScalarType(Entity, IList, DeclType, Index,
1372 CheckVectorType(Entity, IList, DeclType, Index,
1386 CheckStructUnionTypes(Entity, IList, DeclType, Bases, RD->field_begin(),
1393 CheckArrayType(Entity, IList, DeclType, Zero,
1404 CheckReferenceType(Entity, IList, DeclType, Index,
1413 CheckScalarType(Entity, IList, DeclType, Index, StructuredList,
1430 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
1440 return CheckReferenceType(Entity, IList, ElemType, Index,
1472 // we need initialization entity with a type of a vector (and not a vector
1475 (ElemType->isExtVectorType() && !Entity.getType()->isExtVectorType())
1477 : Entity;
1516 expr = HandleEmbed(Embed, Entity);
1542 return CheckScalarType(Entity, IList, ElemType, Index,
1555 initializingConstexprVariable(Entity));
1604 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList,
1627 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr,
1639 void InitListChecker::CheckComplexType(const InitializedEntity &Entity,
1654 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList,
1666 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1675 void InitListChecker::CheckScalarType(const InitializedEntity &Entity,
1712 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList,
1726 expr = HandleEmbed(Embed, Entity);
1731 if (SemaRef.CanPerformCopyInitialization(Entity, expr))
1737 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr,
1762 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity,
1795 if (SemaRef.CanPerformCopyInitialization(Entity,expr))
1801 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr,
1819 void InitListChecker::CheckVectorType(const InitializedEntity &Entity,
1832 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
1844 if (SemaRef.CanPerformCopyInitialization(Entity, Init))
1850 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init,
1874 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1892 const VectorType *T = Entity.getType()->castAs<VectorType>();
1931 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1998 const InitializedEntity &Entity,
2000 QualType InitType = Entity.getType();
2001 const InitializedEntity *Parent = &Entity;
2029 void InitListChecker::CheckArrayType(const InitializedEntity &Entity,
2046 if (canInitializeArrayWithEmbedDataString(IList->inits(), Entity,
2065 initializingConstexprVariable(Entity));
2083 // C23 6.7.10p4: An entity of variable length array type shall not be
2127 if (CheckDesignatedInitializer(Entity, IList, DIE, 0,
2155 SemaRef.Context, StructuredIndex, Entity);
2182 if (maxElements == Zero && !Entity.isVariableLengthArrayNew()) {
2197 Entity.isVariableLengthArrayNew())
2199 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
2204 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity,
2217 } else if (Entity.getKind() != InitializedEntity::EK_Variable) {
2220 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) {
2239 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType,
2289 InitializedEntity::InitializeMember(*Field, &Entity),
2341 SemaRef.Context, &Base, false, &Entity);
2385 Entity, IList, DIE, 0, DeclType, &Field, nullptr, Index,
2479 InitializedEntity::InitializeMember(*Field, &Entity);
2528 InitializedEntity::InitializeMember(*Field, &Entity),
2552 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field,
2560 InitializedEntity::InitializeMember(*Field, &Entity);
2682 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
2705 InitializationSequence Seq(SemaRef, Entity, Kind, Init,
2710 : Seq.Perform(SemaRef, Entity, Kind, Init);
2729 CheckSubElementType(Entity, IList, CurrentObjectType, Index, StructuredList,
3037 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field,
3053 InitializedEntity::InitializeMember(*Field, &Entity);
3072 InitializedEntity::InitializeMember(*Field, &Entity);
3111 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field,
3274 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
3308 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex,
3442 const InitializedEntity &Entity, InitListExpr *From) {
3443 QualType Type = Entity.getType();
3444 InitListChecker Check(*this, Entity, From, Type, /*VerifyOnly=*/true,
3555 // Initialization entity
4120 const InitializedEntity &Entity) {
4121 if (Entity.getKind() != InitializedEntity::EK_Variable)
4124 VarDecl *VD = cast<VarDecl>(Entity.getDecl());
4132 Sequence.AddZeroInitializationStep(Entity.getType());
4141 const InitializedEntity &Entity) {
4146 if (Entity.isParameterKind()) {
4147 if (!Entity.isParameterConsumed())
4150 assert(Entity.getType()->isObjCRetainableType() &&
4152 Sequence.AddProduceObjCObjectStep(Entity.getType());
4158 } else if (Entity.getKind() == InitializedEntity::EK_Result ||
4159 Entity.getKind() == InitializedEntity::EK_StmtExprResult) {
4160 if (!Entity.getType()->isObjCRetainableType())
4163 Sequence.AddProduceObjCObjectStep(Entity.getType());
4168 const InitializedEntity &Entity,
4332 /// enumerates the constructors of the initialized entity and performs overload
4340 /// type as the entity?
4342 const InitializedEntity &Entity,
4365 !(Entity.getKind() != InitializedEntity::EK_Base &&
4366 Entity.getKind() != InitializedEntity::EK_Delegating &&
4367 Entity.getKind() !=
4469 Sequence.RewrapReferenceInitList(Entity.getType(), ILE);
4485 Entity.getType().isConstQualified()) {
4487 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity))
4549 const InitializedEntity &Entity,
4560 const InitializedEntity &Entity,
4567 const InitializedEntity &Entity,
4578 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) {
4583 QualType DestType = Entity.getType();
4610 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1,
4670 const InitializedEntity &Entity,
4675 QualType DestType = Entity.getType();
4685 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence,
4730 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType,
4747 Sequence.InitializeFrom(S, Entity, SubKind, SubInit,
4755 Sequence.RewrapReferenceInitList(Entity.getType(), InitList);
4774 TryValueInitialization(S, Entity, Kind, Sequence, InitList);
4787 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType,
4835 Sequence.RewrapReferenceInitList(Entity.getType(), InitList);
4864 Sequence.InitializeFrom(S, Entity, SubKind, SubInit,
4868 Sequence.RewrapReferenceInitList(Entity.getType(), InitList);
4873 InitListChecker CheckInitList(S, Entity, InitList,
4887 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind,
4890 QualType DestType = Entity.getType();
5067 const InitializedEntity &Entity,
5071 static void TryReferenceInitialization(Sema &S, const InitializedEntity &Entity,
5076 QualType DestType = Entity.getType();
5092 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1,
5110 const InitializedEntity &Entity,
5119 QualType DestType = Entity.getType();
5189 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef,
5280 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer);
5331 S, Entity, Kind, Initializer, /*AllowRValues*/ true,
5434 const InitializedEntity &Entity,
5438 Sequence.AddStringInitStep(Entity.getType());
5443 const InitializedEntity &Entity,
5453 QualType T = Entity.getType();
5484 Sequence.AddZeroInitializationStep(Entity.getType());
5491 // entity of reference type is ill-formed.
5512 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax);
5516 Sequence.AddZeroInitializationStep(Entity.getType());
5521 const InitializedEntity &Entity,
5529 QualType DestType = S.Context.getBaseElementType(Entity.getType());
5535 TryConstructorInitialization(S, Entity, Kind, std::nullopt, DestType,
5536 Entity.getType(), Sequence);
5546 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity))
5553 Sequence.AddZeroInitializationStep(Entity.getType());
5559 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind,
5601 S.getASTContext().getAsArrayType(Entity.getType())) {
5610 S.getASTContext().getAsConstantArrayType(Entity.getType())) {
5612 ResultType = Entity.getType();
5614 S.getASTContext().getAsVariableArrayType(Entity.getType())) {
5624 assert(Entity.getType()->isIncompleteArrayType());
5633 S.getASTContext(), EntityIndexToProcess, Entity);
5640 if (ArrayLength > Args.size() || Entity.isVariableLengthArrayNew()) {
5642 S.getASTContext(), Args.size(), Entity);
5654 } else if (auto *RT = Entity.getType()->getAs<RecordType>()) {
5669 S.getASTContext(), &Base, false, &Entity);
5774 ResultType = Entity.getType();
5782 QualType T = Entity.getType();
5794 Sequence.AddParenthesizedListInitStep(Entity.getType());
6002 const InitializedEntity &Entity,
6005 Entity.getKind() == InitializedEntity::EK_Result &&
6006 Entity.getType()->isPointerType() &&
6119 const InitializedEntity &Entity,
6132 if (!S.ObjC().isObjCWritebackConversion(ArgType, Entity.getType(),
6139 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl()))
6160 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy);
6225 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind,
6229 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList,
6245 /// of entity.
6246 static bool canPerformArrayCopy(const InitializedEntity &Entity) {
6247 switch (Entity.getKind()) {
6258 return isa<DecompositionDecl>(Entity.getDecl());
6264 return Entity.isImplicitMemberInitializer();
6269 if (auto *E = Entity.getParent())
6281 const InitializedEntity &Entity,
6309 QualType DestType = Entity.getType();
6339 TryListInitialization(S, Entity, Kind, InitList, *this,
6361 TryReferenceInitialization(S, Entity, Kind, Args[0], *this,
6369 TryValueInitialization(S, Entity, Kind, *this);
6375 TryDefaultInitialization(S, Entity, Kind, *this);
6396 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this);
6422 Entity.getType()) &&
6423 canPerformArrayCopy(Entity)) {
6432 InitializedEntity::InitializeElement(S.Context, 0, Entity);
6442 AddArrayInitLoopStep(Entity.getType(), InitEltT);
6465 Entity.getKind() == InitializedEntity::EK_Member &&
6467 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer),
6472 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this,
6487 Entity.isParameterKind();
6498 tryObjCWritebackConversion(S, *this, Entity, Initializer)) {
6507 MaybeProduceObjCObject(S, *this, Entity);
6524 TryConstructorInitialization(S, Entity, Kind, Args, DestType, DestType,
6556 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this,
6634 MaybeProduceObjCObject(S, *this, Entity);
6636 AddAtomicConversionStep(Entity.getType());
6674 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl()))
6690 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer))
6691 AddZeroInitializationStep(Entity.getType());
6705 MaybeProduceObjCObject(S, *this, Entity);
6718 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) {
6719 switch(Entity.getKind()) {
6728 if (Entity.getDecl() &&
6729 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext()))
6735 if (Entity.getDecl() &&
6736 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext()))
6772 /// initializing the given entity.
6773 static bool shouldBindAsTemporary(const InitializedEntity &Entity) {
6774 switch (Entity.getKind()) {
6805 /// Whether the given entity, when initialized with an object
6807 static bool shouldDestroyEntity(const InitializedEntity &Entity) {
6808 switch (Entity.getKind()) {
6840 static SourceLocation getInitializationLoc(const InitializedEntity &Entity,
6842 switch (Entity.getKind()) {
6845 return Entity.getReturnLoc();
6848 return Entity.getThrowLoc();
6852 return Entity.getDecl()->getLocation();
6855 return Entity.getCaptureLoc();
6887 /// \param Entity The entity being initialized.
6900 const InitializedEntity &Entity,
6913 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get());
6941 << (int)Entity.getKind() << CurInitExpr->getType()
6951 << (int)Entity.getKind()
6959 << (int)Entity.getKind() << CurInitExpr->getType()
6971 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity,
7041 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity))
7050 const InitializedEntity &Entity,
7058 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr);
7077 << OR << (int)Entity.getKind() << CurInitExpr->getType()
7083 Best->FoundDecl, Entity, Diag);
7105 const InitializedEntity &Entity) {
7106 if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) {
7107 if (Entity.getDecl()->getLocation().isInvalid())
7110 if (Entity.getDecl()->getDeclName())
7111 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here)
7112 << Entity.getDecl()->getDeclName();
7114 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here);
7116 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult &&
7117 Entity.getMethodDecl())
7118 S.Diag(Entity.getMethodDecl()->getLocation(),
7120 << Entity.getMethodDecl()->getDeclName();
7125 static bool isExplicitTemporary(const InitializedEntity &Entity,
7128 switch (Entity.getKind()) {
7151 const InitializedEntity &Entity,
7200 Entity.getType(), Args.front()->getType(), Kind.getLocation());
7209 if (isExplicitTemporary(Entity, Kind, NumArgs)) {
7214 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo();
7216 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc);
7232 Entity.getType().getNonLValueExprType(S.Context), TSInfo,
7240 if (Entity.getKind() == InitializedEntity::EK_Base) {
7241 ConstructKind = Entity.getBaseSpecifier()->isVirtual()
7244 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) {
7256 // If the entity allows NRVO, mark the construction as elidable
7258 if (Entity.allowsNRVO())
7285 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity);
7289 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType()))
7293 if (shouldBindAsTemporary(Entity))
7299 void Sema::checkInitializerLifetime(const InitializedEntity &Entity,
7301 return sema::checkExprLifetime(*this, Entity, Init);
7483 const InitializedEntity &Entity,
7488 Diagnose(S, Entity, Kind, Args);
7492 const Decl *D = Entity.getDecl();
7494 QualType DestType = Entity.getType();
7521 if (ResultType && !Entity.getType()->isDependentType() &&
7523 QualType DeclType = Entity.getType();
7536 // Scavange the location of the brackets from the entity, if we can.
7537 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) {
7573 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() &&
7575 !Entity.isParamOrTemplateParamKind()) {
7585 isa<PredefinedExpr>(Args[0]) && Entity.getType()->isArrayType()) {
7594 QualType ETy = Entity.getType();
7600 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) {
7603 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc());
7607 QualType DestType = Entity.getType().getNonReferenceType();
7608 // FIXME: Ugly hack around the fact that Entity.getType() is not
7609 // the same as Entity.getDecl()->getType() in cases involving type merging,
7612 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() :
7613 Entity.getType();
7686 if (Entity.getKind() == InitializedEntity::EK_Base ||
7687 Entity.getKind() == InitializedEntity::EK_Delegating)
7790 MTETy, CurInit.get(), Entity.getType()->isLValueReferenceType());
7810 if (!shouldBindAsTemporary(Entity))
7812 CurInit = CopyObject(S, Step->Type, Entity, CurInit,
7817 CurInit = CopyObject(S, Step->Type, Entity, CurInit,
7853 Entity);
7883 if (shouldBindAsTemporary(Entity))
7884 // The overall entity is temporary, so this expression should be
7887 else if (CreatedObject && shouldDestroyEntity(Entity)) {
7891 // regardless of how we initialized the entity.
7957 Init, Step->Type, *Step->ICS, getAssignmentAction(Entity), CCK);
7967 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(),
7978 // If we're not initializing the top-level entity, we need to create an
7979 // InitializeTemporary entity for our target type.
7981 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty);
7983 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity;
8017 // to object", we don't get an EK_Temporary entity, but instead an
8018 // EK_Parameter entity with reference type.
8023 Entity.getType().getNonReferenceType());
8024 bool UseTemporary = Entity.getType()->isReferenceType();
8031 Entity,
8063 // to object", we don't get an EK_Temporary entity, but instead an
8064 // EK_Parameter entity with reference type.
8069 Entity.getType().getNonReferenceType());
8070 bool UseTemporary = Entity.getType()->isReferenceType();
8078 S, UseTemporary ? TempEntity : Entity, Kind,
8100 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo();
8106 Entity.getType().getNonLValueExprType(S.Context), TSInfo,
8123 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited);
8131 Entity.isParameterKind() &&
8139 if (S.getLangOpts().C23 && initializingConstexprVariable(Entity)) {
8140 CheckC23ConstexprInitConversion(S, SourceType, Entity.getType(),
8149 if (Entity.getType()->getAs<PointerType>() &&
8160 getAssignmentAction(Entity, true),
8162 PrintInitLocationNote(S, Entity);
8165 PrintInitLocationNote(S, Entity);
8171 bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType();
8175 initializingConstexprVariable(Entity));
8318 if (shouldBindAsTemporary(Entity))
8344 if (Entity.isParameterKind()) {
8428 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this,
8432 if (shouldBindAsTemporary(Entity))
8444 // entity, and if not, either lifetime-extend or warn as appropriate.
8445 S.checkInitializerLifetime(Entity, Init);
8448 if (InitializedEntity::EntityKind EK = Entity.getKind();
8451 cast<FieldDecl>(Entity.getDecl())->isBitField())
8453 cast<FieldDecl>(Entity.getDecl()), Init);
8457 Entity.getKind() == InitializedEntity::EK_Result);
8503 static void emitBadConversionNotes(Sema &S, const InitializedEntity &entity,
8505 QualType destType = entity.getType();
8515 if (entity.getKind() == InitializedEntity::EK_Result)
8534 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity,
8536 QualType DestType = Entity.getType();
8557 if (auto *D = Entity.getDecl())
8563 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType,
8571 const InitializedEntity &Entity,
8577 QualType DestType = Entity.getType();
8605 // FIXME: Customize for the initialized entity?
8622 << 1 << Entity.getType() << Args[0]->getSourceRange();
8712 << (Entity.getKind() == InitializedEntity::EK_Result)
8831 emitBadConversionNotes(S, Entity, Args[0]);
8837 << (int)Entity.getKind()
8844 emitBadConversionNotes(S, Entity, Args[0]);
8875 << 0 << Entity.getType() << Args[0]->getSourceRange();
8902 // FIXME: Using "DestType" for the entity we're printing is probably
8915 (Entity.getKind() == InitializedEntity::EK_Base ||
8916 Entity.getKind() == InitializedEntity::EK_Member ||
8917 Entity.getKind() == InitializedEntity::EK_ParenAggInitMember) &&
8928 if (Entity.getKind() == InitializedEntity::EK_Base) {
8933 << Entity.getType()
8937 = Entity.getBaseSpecifier()->getType()->castAs<RecordType>()
8946 << Entity.getName()
8948 S.Diag(Entity.getDecl()->getLocation(),
8952 = Entity.getType()->getAs<RecordType>())
9005 if (Entity.getKind() == InitializedEntity::EK_Member &&
9016 << Entity.getName();
9017 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl)
9018 << Entity.getName();
9019 } else if (const auto *VD = dyn_cast_if_present<VarDecl>(Entity.getDecl());
9037 diagnoseListInit(S, Entity, InitList);
9061 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this,
9068 << Entity.getType() << InitList->getSourceRange();
9072 PrintInitLocationNote(S, Entity);
9601 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity,
9611 InitializationSequence Seq(*this, Entity, Kind, InitE);
9616 Sema::PerformCopyInitialization(const InitializedEntity &Entity,
9632 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList);
9636 Entity.isParameterKind() && Seq.isConstructorInitialization();
9638 if (llvm::is_contained(CurrentParameterCopyTypes, Entity.getType())) {
9665 CurrentParameterCopyTypes.push_back(Entity.getType());
9668 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE);
9687 TypeSourceInfo *TSInfo, const InitializedEntity &Entity,
9867 InitListChecker CheckInitList(*this, Entity, ListInit, Ty, ElementTypes);