Lines Matching refs:SemaRef
236 Sema &SemaRef;
317 static ExprResult PerformEmptyInit(Sema &SemaRef,
365 ExprResult InitListChecker::PerformEmptyInit(Sema &SemaRef,
373 InitListExpr DummyInitList(SemaRef.Context, Loc, None, Loc);
379 bool EmptyInitList = SemaRef.getLangOpts().CPlusPlus11 &&
392 InitExpr = VerifyOnly ? &DummyInitList : new (SemaRef.Context)
393 InitListExpr(SemaRef.Context, Loc, None, Loc);
394 InitExpr->setType(SemaRef.Context.VoidTy);
402 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit);
413 .BestViableFunction(SemaRef, Kind.getLocation(), Best);
421 SemaRef.SourceMgr.isInSystemHeader(CtorDecl->getLocation())) {
427 if (SemaRef.getStdNamespace()->InEnclosingNamespaceSetOf(ND))
438 SemaRef, Entity,
444 SemaRef.Diag(CtorDecl->getLocation(),
447 SemaRef.Diag(Entity.getDecl()->getLocation(),
450 SemaRef.Diag(Loc, diag::note_used_in_initialization_here);
457 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit);
459 SemaRef.Diag(Entity.getDecl()->getLocation(),
463 SemaRef.Diag(Loc, diag::note_in_omitted_aggregate_initializer)
470 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit);
477 if (PerformEmptyInit(SemaRef, Loc, Entity, /*VerifyOnly*/true).isInvalid())
497 Expr *Filler = new (SemaRef.Context) NoInitExpr(Field->getType());
501 ILE->updateInit(SemaRef.Context, Init, Filler);
509 ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field);
517 ILE->updateInit(SemaRef.Context, Init, DIE.get());
528 SemaRef.Diag(Loc, diag::err_init_reference_member_uninitialized)
531 SemaRef.Diag(Field->getLocation(),
537 ExprResult MemberInit = PerformEmptyInit(SemaRef, Loc, MemberEntity,
553 ILE->updateInit(SemaRef.Context, Init, MemberInit.getAs<Expr>());
574 assert((ILE->getType() != SemaRef.Context.VoidTy) &&
600 ILE->resizeInits(SemaRef.Context, NumFields);
631 if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) {
635 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
640 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
660 Filler = new (SemaRef.Context) NoInitExpr(ElementType);
662 ExprResult ElementInit = PerformEmptyInit(SemaRef, ILE->getLocEnd(),
695 ILE->updateInit(SemaRef.Context, Init, Filler);
714 : SemaRef(S), VerifyOnly(VerifyOnly) {
738 SemaRef.Context.getAsConstantArrayType(DeclType)) {
780 SemaRef.Diag(ParentIList->getInit(Index)->getLocStart(),
817 SemaRef.Diag(StructuredSubobjectInitList->getLocStart(),
823 SemaRef.getLocForEndOfToken(
912 ExprTy = ExprTy.getNonLValueExprType(SemaRef.Context);
922 if (SemaRef.getLangOpts().CPlusPlus ||
923 (SemaRef.getLangOpts().OpenCL &&
931 IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) ==
934 if (SemaRef.getLangOpts().CPlusPlus) {
939 SemaRef.Diag(IList->getInit(Index)->getLocStart(), DK)
953 if (SemaRef.getLangOpts().CPlusPlus) {
957 if (SemaRef.getLangOpts().OpenCL && initKind == 1) {
962 SemaRef.Diag(IList->getInit(Index)->getLocStart(), DK)
969 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange());
1001 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()),
1010 SemaRef.Diag(IList->getLocStart(), diag::err_illegal_initializer_type)
1018 SemaRef.Diag(IList->getLocStart(), diag::err_init_objc_class)
1023 SemaRef.Diag(IList->getLocStart(), diag::err_illegal_initializer_type)
1043 IsStringInit(SubInitList->getInit(0), ElemType, SemaRef.Context) ==
1046 } else if (!SemaRef.getLangOpts().CPlusPlus) {
1070 assert(SemaRef.Context.hasSameType(expr->getType(), ElemType) &&
1078 if (SemaRef.getLangOpts().CPlusPlus) {
1086 InitializationSequence Seq(SemaRef, Entity, Kind, expr,
1098 Seq.Perform(SemaRef, Entity, Kind, expr);
1116 SemaRef.Context.getAsArrayType(ElemType)) {
1121 if (IsStringInit(expr, arrayType, SemaRef.Context) == SIF_None) {
1123 CheckStringInit(expr, ElemType, arrayType, SemaRef);
1145 if (SemaRef.CheckSingleAssignmentConstraints(
1150 ExprRes = SemaRef.DefaultFunctionArrayLvalueConversion(ExprRes.get());
1169 if (!SemaRef.getLangOpts().OpenCL &&
1178 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr,
1207 if (!SemaRef.getLangOpts().CPlusPlus && !VerifyOnly)
1208 SemaRef.Diag(IList->getLocStart(), diag::ext_complex_component_init)
1214 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1231 SemaRef.Diag(IList->getLocStart(),
1232 SemaRef.getLangOpts().CPlusPlus11 ?
1236 hadError = !SemaRef.getLangOpts().CPlusPlus11;
1247 SemaRef.Diag(SubIList->getLocStart(),
1256 SemaRef.Diag(expr->getLocStart(),
1266 if (!SemaRef.CanPerformCopyInitialization(Entity,expr))
1273 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(), expr,
1306 SemaRef.Diag(IList->getLocStart(),
1317 if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus11) {
1319 SemaRef.Diag(IList->getLocStart(), diag::err_init_non_aggr_init_list)
1328 if (!SemaRef.CanPerformCopyInitialization(Entity,expr))
1335 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(), expr,
1365 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
1370 if (!SemaRef.getLangOpts().OpenCL) {
1376 if (!SemaRef.CanPerformCopyInitialization(Entity, Init))
1383 SemaRef.PerformCopyInitialization(Entity, Init->getLocStart(), Init,
1407 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1425 bool isBigEndian = SemaRef.Context.getTargetInfo().isBigEndian();
1439 SemaRef.Diag(IList->getLocStart(),
1443 unsigned typeSize = SemaRef.Context.getTypeSize(elementType);
1454 SemaRef.Diag(IList->getLocStart(),
1455 SemaRef.Context.getTypeSize(VT) > 64 ?
1465 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1486 VecType = SemaRef.Context.getExtVectorType(elementType, numIElts);
1488 VecType = SemaRef.Context.getVectorType(elementType, numIElts,
1499 SemaRef.Diag(IList->getLocStart(),
1513 const ArrayType *arrayType = SemaRef.Context.getAsArrayType(DeclType);
1517 if (IsStringInit(IList->getInit(Index), arrayType, SemaRef.Context) ==
1525 CheckStringInit(IList->getInit(Index), DeclType, arrayType, SemaRef);
1528 StructuredList->resizeInits(SemaRef.Context, StructuredIndex);
1539 SemaRef.Diag(VAT->getSizeExpr()->getLocStart(),
1599 InitializedEntity::InitializeElement(SemaRef.Context, StructuredIndex,
1618 SemaRef.Diag(IList->getLocStart(),
1622 DeclType = SemaRef.Context.getConstantArrayType(elementType, maxElements,
1631 SemaRef.Context, 0, Entity),
1646 } else if (SemaRef.getLangOpts().CPlusPlus) {
1665 SemaRef.Diag(InitExpr->getLocStart(),
1668 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
1785 InvalidUse = !SemaRef.CanUseDecl(*Field);
1787 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field,
1819 SemaRef.Diag(IList->getSourceRange().getEnd(),
1864 static void ExpandAnonymousFieldDesignator(Sema &SemaRef,
1888 DIE->ExpandDesignator(SemaRef.Context, DesigIdx, &Replacements[0],
1892 static DesignatedInitExpr *CloneDesignatedInitExpr(Sema &SemaRef,
1898 return DesignatedInitExpr::Create(SemaRef.Context, DIE->designators_begin(),
2024 new (SemaRef.Context) DesignatedInitUpdateExpr(SemaRef.Context,
2027 StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE);
2051 SemaRef.Diag(D->getLocStart(),
2055 SemaRef.Diag(ExistingInit->getLocStart(),
2081 SemaRef.Diag(Loc, diag::err_field_designator_non_aggr)
2082 << SemaRef.getLangOpts().CPlusPlus << CurrentObjectType;
2099 DIE = CloneDesignatedInitExpr(SemaRef, DIE);
2100 ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx, IFD);
2114 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield)
2116 SemaRef.Diag(Lookup.front()->getLocation(),
2124 if (TypoCorrection Corrected = SemaRef.CorrectTypo(
2129 SemaRef.diagnoseTypo(
2131 SemaRef.PDiag(diag::err_field_designator_unknown_suggest)
2137 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_unknown)
2168 SemaRef.Diag(D->getFieldLoc(),
2172 SemaRef.Diag(ExistingInit->getLocStart(),
2178 StructuredList->resizeInits(SemaRef.Context, 0);
2189 InvalidUse = !SemaRef.CanUseDecl(*Field);
2191 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field, D->getFieldLoc());
2204 StructuredList->resizeInits(SemaRef.Context, FieldIndex + 1);
2216 SemaRef.Diag(NextD->getLocStart(),
2220 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
2230 SemaRef.Diag(DIE->getInit()->getLocStart(),
2233 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
2327 const ArrayType *AT = SemaRef.Context.getAsArrayType(CurrentObjectType);
2330 SemaRef.Diag(D->getLBracketLoc(), diag::err_array_designator_non_array)
2340 DesignatedStartIndex = IndexExpr->EvaluateKnownConstInt(SemaRef.Context);
2346 DIE->getArrayRangeStart(*D)->EvaluateKnownConstInt(SemaRef.Context);
2348 DIE->getArrayRangeEnd(*D)->EvaluateKnownConstInt(SemaRef.Context);
2357 DIE->getInit()->HasSideEffects(SemaRef.Context) && !VerifyOnly)
2371 SemaRef.Diag(IndexExpr->getLocStart(),
2380 ConstantArrayType::getMaxSizeBits(SemaRef.Context);
2392 ASTContext &Context = SemaRef.Context;
2451 StructuredList->resizeInits(SemaRef.Context,
2462 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
2543 SemaRef.Diag(InitRange.getBegin(),
2546 SemaRef.Diag(ExistingInit->getLocStart(),
2553 = new (SemaRef.Context) InitListExpr(SemaRef.Context,
2559 ResultType = ResultType.getNonLValueExprType(SemaRef.Context);
2577 = SemaRef.Context.getAsArrayType(CurrentObjectType)) {
2595 Result->reserveInits(SemaRef.Context, NumElements);
2600 StructuredList->updateInit(SemaRef.Context, StructuredIndex, Result);
2618 if (Expr *PrevInit = StructuredList->updateInit(SemaRef.Context,
2628 SemaRef.Diag(expr->getLocStart(),
2632 SemaRef.Diag(PrevInit->getLocStart(),