Lines Matching defs:SemaRef

897   Sema &SemaRef;
899 CommaVisitor(Sema &SemaRef) : Inherited(SemaRef.Context), SemaRef(SemaRef) {}
902 SemaRef.DiagnoseCommaOperator(E->getLHS(), E->getExprLoc());
2237 static bool FinishForRangeVarDecl(Sema &SemaRef, VarDecl *Decl, Expr *Init,
2240 ExprResult Res = SemaRef.CorrectDelayedTyposInExpr(Init);
2252 SemaRef.Diag(Loc, DiagID) << Init->getType();
2255 TemplateDeductionResult Result = SemaRef.DeduceAutoType(
2259 SemaRef.Diag(Loc, DiagID) << Init->getType();
2271 if (SemaRef.getLangOpts().ObjCAutoRefCount &&
2272 SemaRef.ObjC().inferObjCARCLifetime(Decl))
2275 SemaRef.AddInitializerToDecl(Decl, Init, /*DirectInit=*/false);
2276 SemaRef.FinalizeDeclaration(Decl);
2277 SemaRef.CurContext->addHiddenDecl(Decl);
2293 void NoteForRangeBeginEndFunction(Sema &SemaRef, Expr *E,
2306 Description = SemaRef.getTemplateArgumentBindingsText(
2311 SemaRef.Diag(Loc, diag::note_for_range_begin_end)
2316 VarDecl *BuildForRangeVarDecl(Sema &SemaRef, SourceLocation Loc,
2318 DeclContext *DC = SemaRef.CurContext;
2319 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name);
2320 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc);
2321 VarDecl *Decl = VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type,
2422 BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange,
2428 &SemaRef.PP.getIdentifierTable().get("begin"), ColonLoc);
2429 DeclarationNameInfo EndNameInfo(&SemaRef.PP.getIdentifierTable().get("end"),
2432 LookupResult BeginMemberLookup(SemaRef, BeginNameInfo,
2434 LookupResult EndMemberLookup(SemaRef, EndNameInfo, Sema::LookupMemberName);
2439 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, BeginNameInfo,
2445 SemaRef.Diag(BeginRange->getBeginLoc(), diag::note_in_for_range)
2453 *BeginExpr = SemaRef.ActOnCoawaitExpr(SemaRef.getCurScope(), ColonLoc,
2458 if (FinishForRangeVarDecl(SemaRef, BeginVar, BeginExpr->get(), ColonLoc,
2460 NoteForRangeBeginEndFunction(SemaRef, BeginExpr->get(), *BEF);
2469 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, EndNameInfo,
2474 SemaRef.Diag(EndRange->getBeginLoc(), diag::note_in_for_range)
2478 if (FinishForRangeVarDecl(SemaRef, EndVar, EndExpr->get(), ColonLoc,
2480 NoteForRangeBeginEndFunction(SemaRef, EndExpr->get(), *BEF);
2492 SemaRef.LookupQualifiedName(BeginMemberLookup, D);
2496 SemaRef.LookupQualifiedName(EndMemberLookup, D);
2522 SemaRef.PDiag(diag::err_for_range_invalid)
2524 SemaRef, OCD_AllCandidates, BeginRange);
2529 SemaRef.Diag(D->getLocation(),
2556 static StmtResult RebuildForRangeWithDereference(Sema &SemaRef, Scope *S,
2569 Sema::SFINAETrap Trap(SemaRef);
2571 AdjustedRange = SemaRef.BuildUnaryOp(S, RangeLoc, UO_Deref, Range);
2575 StmtResult SR = SemaRef.ActOnCXXForRangeStmt(
2585 SemaRef.Diag(RangeLoc, diag::err_for_range_dereference)
2587 return SemaRef.ActOnCXXForRangeStmt(
2935 static void DiagnoseForRangeReferenceVariableCopies(Sema &SemaRef,
2974 ReferenceReturnType = SemaRef.Context.getLValueReferenceType(E->getType());
2987 SemaRef.Diag(VD->getLocation(),
2993 SemaRef.Context.getLValueReferenceType(E->getType().withConst());
2994 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_type_or_non_reference)
3002 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_ref_binds_ret_temp)
3006 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_non_reference_type)
3024 static void DiagnoseForRangeConstVariableCopies(Sema &SemaRef,
3045 ASTContext &Ctx = SemaRef.Context;
3053 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_copy)
3055 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_reference_type)
3056 << SemaRef.Context.getLValueReferenceType(VariableType)
3069 static void DiagnoseForRangeVariableCopies(Sema &SemaRef,
3071 if (SemaRef.inTemplateInstantiation())
3074 if (SemaRef.Diags.isIgnored(
3077 SemaRef.Diags.isIgnored(diag::warn_for_range_ref_binds_ret_temp,
3079 SemaRef.Diags.isIgnored(diag::warn_for_range_copy,
3101 DiagnoseForRangeReferenceVariableCopies(SemaRef, VD,
3104 DiagnoseForRangeConstVariableCopies(SemaRef, VD);