Lines Matching defs:SemaRef

951   Sema &SemaRef;
953 CommaVisitor(Sema &SemaRef) : Inherited(SemaRef.Context), SemaRef(SemaRef) {}
956 SemaRef.DiagnoseCommaOperator(E->getLHS(), E->getExprLoc());
2328 static bool FinishForRangeVarDecl(Sema &SemaRef, VarDecl *Decl, Expr *Init,
2331 ExprResult Res = SemaRef.CorrectDelayedTyposInExpr(Init);
2343 SemaRef.Diag(Loc, DiagID) << Init->getType();
2346 TemplateDeductionResult Result = SemaRef.DeduceAutoType(
2350 SemaRef.Diag(Loc, DiagID) << Init->getType();
2362 if (SemaRef.getLangOpts().ObjCAutoRefCount &&
2363 SemaRef.ObjC().inferObjCARCLifetime(Decl))
2366 SemaRef.AddInitializerToDecl(Decl, Init, /*DirectInit=*/false);
2367 SemaRef.FinalizeDeclaration(Decl);
2368 SemaRef.CurContext->addHiddenDecl(Decl);
2384 void NoteForRangeBeginEndFunction(Sema &SemaRef, Expr *E,
2397 Description = SemaRef.getTemplateArgumentBindingsText(
2402 SemaRef.Diag(Loc, diag::note_for_range_begin_end)
2407 VarDecl *BuildForRangeVarDecl(Sema &SemaRef, SourceLocation Loc,
2409 DeclContext *DC = SemaRef.CurContext;
2410 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name);
2411 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc);
2412 VarDecl *Decl = VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type,
2513 BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange,
2519 &SemaRef.PP.getIdentifierTable().get("begin"), ColonLoc);
2520 DeclarationNameInfo EndNameInfo(&SemaRef.PP.getIdentifierTable().get("end"),
2523 LookupResult BeginMemberLookup(SemaRef, BeginNameInfo,
2525 LookupResult EndMemberLookup(SemaRef, EndNameInfo, Sema::LookupMemberName);
2530 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, BeginNameInfo,
2536 SemaRef.Diag(BeginRange->getBeginLoc(), diag::note_in_for_range)
2544 *BeginExpr = SemaRef.ActOnCoawaitExpr(SemaRef.getCurScope(), ColonLoc,
2549 if (FinishForRangeVarDecl(SemaRef, BeginVar, BeginExpr->get(), ColonLoc,
2551 NoteForRangeBeginEndFunction(SemaRef, BeginExpr->get(), *BEF);
2560 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, EndNameInfo,
2565 SemaRef.Diag(EndRange->getBeginLoc(), diag::note_in_for_range)
2569 if (FinishForRangeVarDecl(SemaRef, EndVar, EndExpr->get(), ColonLoc,
2571 NoteForRangeBeginEndFunction(SemaRef, EndExpr->get(), *BEF);
2583 SemaRef.LookupQualifiedName(BeginMemberLookup, D);
2587 SemaRef.LookupQualifiedName(EndMemberLookup, D);
2613 SemaRef.PDiag(diag::err_for_range_invalid)
2615 SemaRef, OCD_AllCandidates, BeginRange);
2620 SemaRef.Diag(D->getLocation(),
2647 static StmtResult RebuildForRangeWithDereference(Sema &SemaRef, Scope *S,
2660 Sema::SFINAETrap Trap(SemaRef);
2662 AdjustedRange = SemaRef.BuildUnaryOp(S, RangeLoc, UO_Deref, Range);
2666 StmtResult SR = SemaRef.ActOnCXXForRangeStmt(
2676 SemaRef.Diag(RangeLoc, diag::err_for_range_dereference)
2678 return SemaRef.ActOnCXXForRangeStmt(
3028 static void DiagnoseForRangeReferenceVariableCopies(Sema &SemaRef,
3067 ReferenceReturnType = SemaRef.Context.getLValueReferenceType(E->getType());
3080 SemaRef.Diag(VD->getLocation(),
3086 SemaRef.Context.getLValueReferenceType(E->getType().withConst());
3087 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_type_or_non_reference)
3095 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_ref_binds_ret_temp)
3099 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_non_reference_type)
3117 static void DiagnoseForRangeConstVariableCopies(Sema &SemaRef,
3138 ASTContext &Ctx = SemaRef.Context;
3146 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_copy)
3148 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_reference_type)
3149 << SemaRef.Context.getLValueReferenceType(VariableType)
3162 static void DiagnoseForRangeVariableCopies(Sema &SemaRef,
3164 if (SemaRef.inTemplateInstantiation())
3167 if (SemaRef.Diags.isIgnored(
3170 SemaRef.Diags.isIgnored(diag::warn_for_range_ref_binds_ret_temp,
3172 SemaRef.Diags.isIgnored(diag::warn_for_range_copy,
3194 DiagnoseForRangeReferenceVariableCopies(SemaRef, VD,
3197 DiagnoseForRangeConstVariableCopies(SemaRef, VD);