Lines Matching defs:SemaRef
171 Sema &SemaRef;
282 InitializationSequence InitSeq(SemaRef, Entity, Kind, 0, 0);
304 SemaRef.Diag(Loc, diag::err_init_reference_member_uninitialized)
307 SemaRef.Diag(Field->getLocation(),
315 InitializationSequence InitSeq(SemaRef, MemberEntity, Kind, 0, 0);
317 InitSeq.Diagnose(SemaRef, MemberEntity, Kind, 0, 0);
323 = InitSeq.Perform(SemaRef, MemberEntity, Kind, MultiExprArg());
338 ILE->updateInit(SemaRef.Context, Init, MemberInit.takeAs<Expr>());
354 assert((ILE->getType() != SemaRef.Context.VoidTy) &&
397 if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) {
401 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
406 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
424 InitializationSequence InitSeq(SemaRef, ElementEntity, Kind, 0, 0);
426 InitSeq.Diagnose(SemaRef, ElementEntity, Kind, 0, 0);
432 = InitSeq.Perform(SemaRef, ElementEntity, Kind, MultiExprArg());
460 ILE->updateInit(SemaRef.Context, Init, ElementInit.takeAs<Expr>());
474 : SemaRef(S), VerifyOnly(VerifyOnly), AllowBraceElision(AllowBraceElision) {
498 SemaRef.Context.getAsConstantArrayType(DeclType)) {
537 SemaRef.Diag(ParentIList->getInit(Index)->getLocStart(),
576 SemaRef.Diag(StructuredSubobjectInitList->getLocStart(),
583 SemaRef.PP.getLocForEndOfToken(
608 ExprTy = ExprTy.getNonLValueExprType(SemaRef.Context);
618 if (SemaRef.getLangOpts().CPlusPlus ||
619 (SemaRef.getLangOpts().OpenCL &&
627 IsStringInit(StructuredList->getInit(0), T, SemaRef.Context)) {
629 if (SemaRef.getLangOpts().CPlusPlus) {
634 SemaRef.Diag(IList->getInit(Index)->getLocStart(), DK)
648 if (SemaRef.getLangOpts().CPlusPlus) {
652 if (SemaRef.getLangOpts().OpenCL && initKind == 1) {
657 SemaRef.Diag(IList->getInit(Index)->getLocStart(), DK)
664 SemaRef.Diag(IList->getLocStart(), diag::warn_braces_around_scalar_init)
699 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()),
708 SemaRef.Diag(IList->getLocStart(), diag::err_illegal_initializer_type)
716 SemaRef.Diag(IList->getLocStart(), diag::err_init_objc_class)
721 SemaRef.Diag(IList->getLocStart(), diag::err_illegal_initializer_type)
748 assert(SemaRef.getLangOpts().CPlusPlus &&
761 if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) {
766 if (Expr *Str = IsStringInit(expr, arrayType, SemaRef.Context)) {
768 CheckStringInit(Str, ElemType, arrayType, SemaRef);
777 } else if (SemaRef.getLangOpts().CPlusPlus) {
787 InitializationSequence Seq(SemaRef, Entity, Kind, &expr, 1);
792 Seq.Perform(SemaRef, Entity, Kind, MultiExprArg(&expr, 1));
813 ExprResult ExprRes = SemaRef.Owned(expr);
815 SemaRef.CheckSingleAssignmentConstraints(ElemType, ExprRes,
821 ExprRes = SemaRef.DefaultFunctionArrayLvalueConversion(ExprRes.take());
840 if (!SemaRef.getLangOpts().OpenCL &&
849 SemaRef.PerformCopyInitialization(Entity, SourceLocation(),
850 SemaRef.Owned(expr),
879 if (!SemaRef.getLangOpts().CPlusPlus && !VerifyOnly)
880 SemaRef.Diag(IList->getLocStart(), diag::ext_complex_component_init)
886 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
903 SemaRef.Diag(IList->getLocStart(),
904 SemaRef.getLangOpts().CPlusPlus11 ?
908 hadError = !SemaRef.getLangOpts().CPlusPlus11;
917 SemaRef.Diag(SubIList->getLocStart(),
926 SemaRef.Diag(expr->getLocStart(),
936 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(expr)))
943 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
944 SemaRef.Owned(expr),
977 SemaRef.Diag(IList->getLocStart(),
988 if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus11) {
990 SemaRef.Diag(IList->getLocStart(), diag::err_init_non_aggr_init_list)
999 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(expr)))
1006 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
1007 SemaRef.Owned(expr),
1037 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity));
1041 if (!SemaRef.getLangOpts().OpenCL) {
1047 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(Init)))
1054 SemaRef.PerformCopyInitialization(Entity, Init->getLocStart(),
1055 SemaRef.Owned(Init),
1079 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1097 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1118 VecType = SemaRef.Context.getExtVectorType(elementType, numIElts);
1120 VecType = SemaRef.Context.getVectorType(elementType, numIElts,
1131 SemaRef.Diag(IList->getLocStart(),
1145 const ArrayType *arrayType = SemaRef.Context.getAsArrayType(DeclType);
1150 SemaRef.Context)) {
1157 CheckStringInit(Str, DeclType, arrayType, SemaRef);
1159 StructuredList->resizeInits(SemaRef.Context, StructuredIndex);
1170 SemaRef.Diag(VAT->getSizeExpr()->getLocStart(),
1230 InitializedEntity::InitializeElement(SemaRef.Context, StructuredIndex,
1249 SemaRef.Diag(IList->getLocStart(),
1253 DeclType = SemaRef.Context.getConstantArrayType(elementType, maxElements,
1262 SemaRef.Context, 0, Entity));
1276 } else if (SemaRef.getLangOpts().CPlusPlus) {
1295 SemaRef.Diag(InitExpr->getLocStart(),
1298 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
1398 InvalidUse = !SemaRef.CanUseDecl(*Field);
1400 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field,
1432 SemaRef.Diag(IList->getSourceRange().getEnd(),
1476 static void ExpandAnonymousFieldDesignator(Sema &SemaRef,
1500 DIE->ExpandDesignator(SemaRef.Context, DesigIdx, &Replacements[0],
1522 static DesignatedInitExpr *CloneDesignatedInitExpr(Sema &SemaRef,
1528 return DesignatedInitExpr::Create(SemaRef.Context, DIE->designators_begin(),
1656 SemaRef.Diag(Loc, diag::err_field_designator_non_aggr)
1657 << SemaRef.getLangOpts().CPlusPlus << CurrentObjectType;
1682 DIE = CloneDesignatedInitExpr(SemaRef, DIE);
1683 ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx, IF);
1713 TypoCorrection Corrected = SemaRef.CorrectTypo(
1719 Corrected.getAsString(SemaRef.getLangOpts()));
1721 Corrected.getQuoted(SemaRef.getLangOpts()));
1723 SemaRef.Diag(D->getFieldLoc(),
1727 SemaRef.Diag(ReplacementField->getLocation(),
1731 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_unknown)
1740 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield)
1742 SemaRef.Diag(Lookup.front()->getLocation(),
1777 InvalidUse = !SemaRef.CanUseDecl(*Field);
1779 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field, D->getFieldLoc());
1792 StructuredList->resizeInits(SemaRef.Context, FieldIndex + 1);
1804 SemaRef.Diag(NextD->getLocStart(),
1808 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
1818 SemaRef.Diag(DIE->getInit()->getLocStart(),
1821 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
1915 const ArrayType *AT = SemaRef.Context.getAsArrayType(CurrentObjectType);
1918 SemaRef.Diag(D->getLBracketLoc(), diag::err_array_designator_non_array)
1928 DesignatedStartIndex = IndexExpr->EvaluateKnownConstInt(SemaRef.Context);
1934 DIE->getArrayRangeStart(*D)->EvaluateKnownConstInt(SemaRef.Context);
1936 DIE->getArrayRangeEnd(*D)->EvaluateKnownConstInt(SemaRef.Context);
1945 DIE->getInit()->HasSideEffects(SemaRef.Context) && !VerifyOnly)
1959 SemaRef.Diag(IndexExpr->getLocStart(),
1983 StructuredList->resizeInits(SemaRef.Context,
1994 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
2065 SemaRef.Diag(InitRange.getBegin(),
2068 SemaRef.Diag(ExistingInit->getLocStart(),
2075 = new (SemaRef.Context) InitListExpr(SemaRef.Context,
2081 ResultType = ResultType.getNonLValueExprType(SemaRef.Context);
2099 = SemaRef.Context.getAsArrayType(CurrentObjectType)) {
2118 Result->reserveInits(SemaRef.Context, NumElements);
2123 StructuredList->updateInit(SemaRef.Context, StructuredIndex, Result);
2141 if (Expr *PrevInit = StructuredList->updateInit(SemaRef.Context,
2144 SemaRef.Diag(expr->getLocStart(),
2147 SemaRef.Diag(PrevInit->getLocStart(),