• Home
  • Raw
  • Download

Lines Matching refs:SemaRef

285   Sema &SemaRef;  member in __anon421e39800111::InitListChecker
295 DummyExpr = new (SemaRef.Context) NoInitExpr(SemaRef.Context.VoidTy); in getDummyInit()
386 unsigned DiagID = SemaRef.getLangOpts().CPlusPlus in diagnoseInitOverride()
390 if (InOverloadResolution && SemaRef.getLangOpts().CPlusPlus) { in diagnoseInitOverride()
430 SemaRef.Diag(NewInitRange.getBegin(), DiagID) in diagnoseInitOverride()
432 SemaRef.Diag(OldInit->getBeginLoc(), diag::note_previous_initializer) in diagnoseInitOverride()
433 << (OldInit->HasSideEffects(SemaRef.Context) && FullyOverwritten) in diagnoseInitOverride()
494 InitListExpr DummyInitList(SemaRef.Context, Loc, None, Loc); in PerformEmptyInit()
500 bool EmptyInitList = SemaRef.getLangOpts().CPlusPlus11 && in PerformEmptyInit()
513 InitExpr = VerifyOnly ? &DummyInitList : new (SemaRef.Context) in PerformEmptyInit()
514 InitListExpr(SemaRef.Context, Loc, None, Loc); in PerformEmptyInit()
515 InitExpr->setType(SemaRef.Context.VoidTy); in PerformEmptyInit()
523 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
534 .BestViableFunction(SemaRef, Kind.getLocation(), Best); in PerformEmptyInit()
542 SemaRef.SourceMgr.isInSystemHeader(CtorDecl->getLocation())) { in PerformEmptyInit()
546 if (SemaRef.getStdNamespace()->InEnclosingNamespaceSetOf(ND)) in PerformEmptyInit()
557 SemaRef, Entity, in PerformEmptyInit()
564 SemaRef.Diag(CtorDecl->getLocation(), in PerformEmptyInit()
567 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
570 SemaRef.Diag(Loc, diag::note_used_in_initialization_here); in PerformEmptyInit()
577 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
579 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
586 SemaRef.Diag(Loc, diag::note_in_omitted_aggregate_initializer) in PerformEmptyInit()
596 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
614 SemaRef.Context, &Base, false, &ParentEntity); in FillInEmptyInitForBase()
618 ? new (SemaRef.Context) NoInitExpr(Base.getType()) in FillInEmptyInitForBase()
659 Expr *Filler = new (SemaRef.Context) NoInitExpr(Field->getType()); in FillInEmptyInitForField()
663 ILE->updateInit(SemaRef.Context, Init, Filler); in FillInEmptyInitForField()
674 ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field); in FillInEmptyInitForField()
679 SemaRef.checkInitializerLifetime(MemberEntity, DIE.get()); in FillInEmptyInitForField()
683 ILE->updateInit(SemaRef.Context, Init, DIE.get()); in FillInEmptyInitForField()
695 SemaRef.Diag(Loc, diag::err_init_reference_member_uninitialized) in FillInEmptyInitForField()
698 SemaRef.Diag(Field->getLocation(), in FillInEmptyInitForField()
720 ILE->updateInit(SemaRef.Context, Init, MemberInit.getAs<Expr>()); in FillInEmptyInitForField()
745 assert((ILE->getType() != SemaRef.Context.VoidTy) && in FillInEmptyInitializations()
796 ILE->resizeInits(SemaRef.Context, NumElems); in FillInEmptyInitializations()
839 if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) { in FillInEmptyInitializations()
847 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context, in FillInEmptyInitializations()
852 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context, in FillInEmptyInitializations()
881 Filler = new (SemaRef.Context) NoInitExpr(ElementType); in FillInEmptyInitializations()
917 ILE->updateInit(SemaRef.Context, Init, Filler); in FillInEmptyInitializations()
945 : SemaRef(S), VerifyOnly(VerifyOnly), in InitListChecker()
977 SemaRef.Context.getAsConstantArrayType(DeclType)) { in numArrayElements()
1049 SemaRef.Diag(ParentIList->getInit(Index)->getBeginLoc(), in CheckImplicitInitList()
1085 !ParentIList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()) && in CheckImplicitInitList()
1087 SemaRef.Diag(StructuredSubobjectInitList->getBeginLoc(), in CheckImplicitInitList()
1093 SemaRef.getLocForEndOfToken( in CheckImplicitInitList()
1101 SemaRef.Diag(StructuredSubobjectInitList->getBeginLoc(), in CheckImplicitInitList()
1188 ExprTy = ExprTy.getNonLValueExprType(SemaRef.Context); in CheckExplicitInitList()
1199 bool ExtraInitsIsError = SemaRef.getLangOpts().CPlusPlus || in CheckExplicitInitList()
1200 (SemaRef.getLangOpts().OpenCL && T->isVectorType()); in CheckExplicitInitList()
1205 IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) == in CheckExplicitInitList()
1211 SemaRef.Diag(IList->getInit(Index)->getBeginLoc(), DK) in CheckExplicitInitList()
1217 SemaRef.Diag(IList->getInit(Index)->getBeginLoc(), DK) in CheckExplicitInitList()
1228 SemaRef.Diag(IList->getInit(Index)->getBeginLoc(), DK) in CheckExplicitInitList()
1236 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange()); in CheckExplicitInitList()
1246 auto *CD = SemaRef.LookupDefaultConstructor(CXXRD); in CheckExplicitInitList()
1251 SemaRef.Diag(IList->getBeginLoc(), in CheckExplicitInitList()
1292 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()), in CheckListElementTypes()
1301 SemaRef.Diag(IList->getBeginLoc(), diag::err_illegal_initializer_type) in CheckListElementTypes()
1309 SemaRef.Diag(IList->getBeginLoc(), diag::err_init_objc_class) << DeclType; in CheckListElementTypes()
1318 SemaRef.Diag(IList->getBeginLoc(), diag::err_illegal_initializer_type) in CheckListElementTypes()
1338 IsStringInit(SubInitList->getInit(0), ElemType, SemaRef.Context) == in CheckSubElementType()
1348 assert(SemaRef.Context.hasSameType(expr->getType(), ElemType) && in CheckSubElementType()
1355 if (SemaRef.getLangOpts().CPlusPlus || isa<InitListExpr>(expr)) { in CheckSubElementType()
1372 InitializationSequence Seq(SemaRef, TmpEntity, Kind, expr, in CheckSubElementType()
1383 ExprResult Result = Seq.Perform(SemaRef, TmpEntity, Kind, expr); in CheckSubElementType()
1405 SemaRef.Context.getAsArrayType(ElemType)) { in CheckSubElementType()
1410 if (IsStringInit(expr, arrayType, SemaRef.Context) == SIF_None) { in CheckSubElementType()
1413 CheckStringInit(expr, ElemType, arrayType, SemaRef); in CheckSubElementType()
1435 if (SemaRef.CheckSingleAssignmentConstraints( in CheckSubElementType()
1440 ExprRes = SemaRef.DefaultFunctionArrayLvalueConversion(ExprRes.get()); in CheckSubElementType()
1460 if ((!SemaRef.getLangOpts().OpenCL && ElemType->isVectorType()) || in CheckSubElementType()
1471 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr, in CheckSubElementType()
1503 if (!SemaRef.getLangOpts().CPlusPlus && !VerifyOnly) in CheckComplexType()
1504 SemaRef.Diag(IList->getBeginLoc(), diag::ext_complex_component_init) in CheckComplexType()
1510 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckComplexType()
1527 SemaRef.Diag(IList->getBeginLoc(), in CheckScalarType()
1528 SemaRef.getLangOpts().CPlusPlus11 in CheckScalarType()
1533 SemaRef.Diag(IList->getBeginLoc(), in CheckScalarType()
1534 SemaRef.getLangOpts().CPlusPlus11 in CheckScalarType()
1539 hadError = !SemaRef.getLangOpts().CPlusPlus11; in CheckScalarType()
1550 SemaRef.Diag(SubIList->getBeginLoc(), diag::ext_many_braces_around_init) in CheckScalarType()
1558 SemaRef.Diag(expr->getBeginLoc(), in CheckScalarType()
1570 if (SemaRef.CanPerformCopyInitialization(Entity, expr)) in CheckScalarType()
1576 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckScalarType()
1608 SemaRef.Diag(IList->getBeginLoc(), in CheckReferenceType()
1618 if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus11) { in CheckReferenceType()
1620 SemaRef.Diag(IList->getBeginLoc(), diag::err_init_non_aggr_init_list) in CheckReferenceType()
1630 if (SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckReferenceType()
1636 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckReferenceType()
1665 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckVectorType()
1670 if (!SemaRef.getLangOpts().OpenCL) { in CheckVectorType()
1677 if (SemaRef.CanPerformCopyInitialization(Entity, Init)) in CheckVectorType()
1683 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init, in CheckVectorType()
1705 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1722 bool isBigEndian = SemaRef.Context.getTargetInfo().isBigEndian(); in CheckVectorType()
1736 SemaRef.Diag(IList->getBeginLoc(), in CheckVectorType()
1740 unsigned typeSize = SemaRef.Context.getTypeSize(elementType); in CheckVectorType()
1751 SemaRef.Diag(IList->getBeginLoc(), in CheckVectorType()
1752 SemaRef.Context.getTypeSize(VT) > 64 in CheckVectorType()
1762 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1783 VecType = SemaRef.Context.getExtVectorType(elementType, numIElts); in CheckVectorType()
1785 VecType = SemaRef.Context.getVectorType(elementType, numIElts, in CheckVectorType()
1796 SemaRef.Diag(IList->getBeginLoc(), in CheckVectorType()
1814 Sema &SemaRef) { in checkDestructorReference() argument
1819 CXXDestructorDecl *Destructor = SemaRef.LookupDestructor(CXXRD); in checkDestructorReference()
1820 SemaRef.CheckDestructorAccess(Loc, Destructor, in checkDestructorReference()
1821 SemaRef.PDiag(diag::err_access_dtor_temp) in checkDestructorReference()
1823 SemaRef.MarkFunctionReferenced(Loc, Destructor); in checkDestructorReference()
1824 return SemaRef.DiagnoseUseOfDecl(Destructor, Loc); in checkDestructorReference()
1834 const ArrayType *arrayType = SemaRef.Context.getAsArrayType(DeclType); in CheckArrayType()
1838 IList->getEndLoc(), SemaRef)) { in CheckArrayType()
1846 if (IsStringInit(IList->getInit(Index), arrayType, SemaRef.Context) == in CheckArrayType()
1855 CheckStringInit(IList->getInit(Index), DeclType, arrayType, SemaRef); in CheckArrayType()
1859 StructuredList->resizeInits(SemaRef.Context, StructuredIndex); in CheckArrayType()
1870 SemaRef.Diag(VAT->getSizeExpr()->getBeginLoc(), in CheckArrayType()
1930 InitializedEntity::InitializeElement(SemaRef.Context, StructuredIndex, in CheckArrayType()
1949 SemaRef.Diag(IList->getBeginLoc(), diag::ext_typecheck_zero_array_size); in CheckArrayType()
1952 DeclType = SemaRef.Context.getConstantArrayType( in CheckArrayType()
1963 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckArrayType()
1978 } else if (SemaRef.getLangOpts().CPlusPlus) { in CheckFlexibleArrayInit()
1997 SemaRef.Diag(InitExpr->getBeginLoc(), FlexArrayDiag) in CheckFlexibleArrayInit()
1999 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) in CheckFlexibleArrayInit()
2028 QualType ET = SemaRef.Context.getBaseElementType(FD->getType()); in CheckStructUnionTypes()
2029 if (checkDestructorReference(ET, IList->getEndLoc(), SemaRef)) { in CheckStructUnionTypes()
2079 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
2089 if (checkDestructorReference(Base.getType(), InitLoc, SemaRef)) { in CheckStructUnionTypes()
2102 !IList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()); in CheckStructUnionTypes()
2130 QualType ET = SemaRef.Context.getBaseElementType(F->getType()); in CheckStructUnionTypes()
2131 if (checkDestructorReference(ET, InitLoc, SemaRef)) { in CheckStructUnionTypes()
2167 InvalidUse = !SemaRef.CanUseDecl(*Field, TreatUnavailableAsInvalid); in CheckStructUnionTypes()
2169 InvalidUse = SemaRef.DiagnoseUseOfDecl( in CheckStructUnionTypes()
2179 QualType ET = SemaRef.Context.getBaseElementType(Field->getType()); in CheckStructUnionTypes()
2180 if (checkDestructorReference(ET, InitLoc, SemaRef)) { in CheckStructUnionTypes()
2209 SemaRef.Diag(IList->getSourceRange().getEnd(), in CheckStructUnionTypes()
2235 QualType ET = SemaRef.Context.getBaseElementType(I->getType()); in CheckStructUnionTypes()
2236 if (checkDestructorReference(ET, IList->getEndLoc(), SemaRef)) { in CheckStructUnionTypes()
2269 static void ExpandAnonymousFieldDesignator(Sema &SemaRef, in ExpandAnonymousFieldDesignator() argument
2293 DIE->ExpandDesignator(SemaRef.Context, DesigIdx, &Replacements[0], in ExpandAnonymousFieldDesignator()
2297 static DesignatedInitExpr *CloneDesignatedInitExpr(Sema &SemaRef, in CloneDesignatedInitExpr() argument
2303 return DesignatedInitExpr::Create(SemaRef.Context, DIE->designators(), in CloneDesignatedInitExpr()
2394 InitializationSequence Seq(SemaRef, Entity, Kind, Init, in CheckDesignatedInitializer()
2399 : Seq.Perform(SemaRef, Entity, Kind, Init); in CheckDesignatedInitializer()
2468 DesignatedInitUpdateExpr *DIUE = new (SemaRef.Context) in CheckDesignatedInitializer()
2469 DesignatedInitUpdateExpr(SemaRef.Context, D->getBeginLoc(), in CheckDesignatedInitializer()
2471 StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE); in CheckDesignatedInitializer()
2502 SemaRef.Diag(Loc, diag::err_field_designator_non_aggr) in CheckDesignatedInitializer()
2503 << SemaRef.getLangOpts().CPlusPlus << CurrentObjectType; in CheckDesignatedInitializer()
2520 DIE = CloneDesignatedInitExpr(SemaRef, DIE); in CheckDesignatedInitializer()
2521 ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx, IFD); in CheckDesignatedInitializer()
2535 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield) in CheckDesignatedInitializer()
2537 SemaRef.Diag(Lookup.front()->getLocation(), in CheckDesignatedInitializer()
2546 if (TypoCorrection Corrected = SemaRef.CorrectTypo( in CheckDesignatedInitializer()
2550 SemaRef.diagnoseTypo( in CheckDesignatedInitializer()
2552 SemaRef.PDiag(diag::err_field_designator_unknown_suggest) in CheckDesignatedInitializer()
2558 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_unknown) in CheckDesignatedInitializer()
2603 StructuredList->resizeInits(SemaRef.Context, 0); in CheckDesignatedInitializer()
2614 InvalidUse = !SemaRef.CanUseDecl(*Field, TreatUnavailableAsInvalid); in CheckDesignatedInitializer()
2616 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field, D->getFieldLoc()); in CheckDesignatedInitializer()
2637 if (IsFirstDesignator && !VerifyOnly && SemaRef.getLangOpts().CPlusPlus && in CheckDesignatedInitializer()
2655 SemaRef.Diag(DIE->getBeginLoc(), diag::ext_designated_init_reordered) in CheckDesignatedInitializer()
2661 SemaRef.Diag(PrevInit->getBeginLoc(), in CheckDesignatedInitializer()
2677 StructuredList->resizeInits(SemaRef.Context, FieldIndex + 1); in CheckDesignatedInitializer()
2688 SemaRef.Diag(NextD->getBeginLoc(), in CheckDesignatedInitializer()
2691 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) in CheckDesignatedInitializer()
2701 SemaRef.Diag(DIE->getInit()->getBeginLoc(), in CheckDesignatedInitializer()
2704 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) in CheckDesignatedInitializer()
2801 const ArrayType *AT = SemaRef.Context.getAsArrayType(CurrentObjectType); in CheckDesignatedInitializer()
2804 SemaRef.Diag(D->getLBracketLoc(), diag::err_array_designator_non_array) in CheckDesignatedInitializer()
2814 DesignatedStartIndex = IndexExpr->EvaluateKnownConstInt(SemaRef.Context); in CheckDesignatedInitializer()
2820 DIE->getArrayRangeStart(*D)->EvaluateKnownConstInt(SemaRef.Context); in CheckDesignatedInitializer()
2822 DIE->getArrayRangeEnd(*D)->EvaluateKnownConstInt(SemaRef.Context); in CheckDesignatedInitializer()
2831 DIE->getInit()->HasSideEffects(SemaRef.Context) && !VerifyOnly) in CheckDesignatedInitializer()
2845 SemaRef.Diag(IndexExpr->getBeginLoc(), in CheckDesignatedInitializer()
2854 ConstantArrayType::getMaxSizeBits(SemaRef.Context); in CheckDesignatedInitializer()
2872 ASTContext &Context = SemaRef.Context; in CheckDesignatedInitializer()
2933 StructuredList->resizeInits(SemaRef.Context, in CheckDesignatedInitializer()
2944 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
3048 StructuredList->updateInit(SemaRef.Context, StructuredIndex, Result); in getStructuredSubobjectInit()
3057 = new (SemaRef.Context) InitListExpr(SemaRef.Context, in createInitListExpr()
3063 ResultType = ResultType.getNonLValueExprType(SemaRef.Context); in createInitListExpr()
3070 = SemaRef.Context.getAsArrayType(CurrentObjectType)) { in createInitListExpr()
3084 Result->reserveInits(SemaRef.Context, NumElements); in createInitListExpr()
3098 if (Expr *PrevInit = StructuredList->updateInit(SemaRef.Context, in UpdateStructuredListElement()