Lines Matching refs:SemaRef
569 Sema &SemaRef; member in __anon53e299540311::CommaVisitor
571 CommaVisitor(Sema &SemaRef) : Inherited(SemaRef.Context), SemaRef(SemaRef) {} in CommaVisitor() argument
574 SemaRef.DiagnoseCommaOperator(E->getLHS(), E->getExprLoc()); in VisitBinaryOperator()
2035 static bool FinishForRangeVarDecl(Sema &SemaRef, VarDecl *Decl, Expr *Init, in FinishForRangeVarDecl() argument
2038 ExprResult Res = SemaRef.CorrectDelayedTyposInExpr(Init); in FinishForRangeVarDecl()
2050 SemaRef.DeduceAutoType(Decl->getTypeSourceInfo(), Init, InitType) == in FinishForRangeVarDecl()
2052 SemaRef.Diag(Loc, DiagID) << Init->getType(); in FinishForRangeVarDecl()
2062 if (SemaRef.getLangOpts().ObjCAutoRefCount && in FinishForRangeVarDecl()
2063 SemaRef.inferObjCARCLifetime(Decl)) in FinishForRangeVarDecl()
2066 SemaRef.AddInitializerToDecl(Decl, Init, /*DirectInit=*/false); in FinishForRangeVarDecl()
2067 SemaRef.FinalizeDeclaration(Decl); in FinishForRangeVarDecl()
2068 SemaRef.CurContext->addHiddenDecl(Decl); in FinishForRangeVarDecl()
2084 void NoteForRangeBeginEndFunction(Sema &SemaRef, Expr *E, in NoteForRangeBeginEndFunction() argument
2097 Description = SemaRef.getTemplateArgumentBindingsText( in NoteForRangeBeginEndFunction()
2102 SemaRef.Diag(Loc, diag::note_for_range_begin_end) in NoteForRangeBeginEndFunction()
2107 VarDecl *BuildForRangeVarDecl(Sema &SemaRef, SourceLocation Loc, in BuildForRangeVarDecl() argument
2109 DeclContext *DC = SemaRef.CurContext; in BuildForRangeVarDecl()
2110 IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name); in BuildForRangeVarDecl()
2111 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc); in BuildForRangeVarDecl()
2112 VarDecl *Decl = VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, in BuildForRangeVarDecl()
2229 BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange, in BuildNonArrayForRange() argument
2235 &SemaRef.PP.getIdentifierTable().get("begin"), ColonLoc); in BuildNonArrayForRange()
2236 DeclarationNameInfo EndNameInfo(&SemaRef.PP.getIdentifierTable().get("end"), in BuildNonArrayForRange()
2239 LookupResult BeginMemberLookup(SemaRef, BeginNameInfo, in BuildNonArrayForRange()
2241 LookupResult EndMemberLookup(SemaRef, EndNameInfo, Sema::LookupMemberName); in BuildNonArrayForRange()
2246 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, BeginNameInfo, in BuildNonArrayForRange()
2252 SemaRef.Diag(BeginRange->getBeginLoc(), diag::note_in_for_range) in BuildNonArrayForRange()
2260 *BeginExpr = SemaRef.ActOnCoawaitExpr(SemaRef.getCurScope(), ColonLoc, in BuildNonArrayForRange()
2265 if (FinishForRangeVarDecl(SemaRef, BeginVar, BeginExpr->get(), ColonLoc, in BuildNonArrayForRange()
2267 NoteForRangeBeginEndFunction(SemaRef, BeginExpr->get(), *BEF); in BuildNonArrayForRange()
2276 SemaRef.BuildForRangeBeginEndCall(ColonLoc, ColonLoc, EndNameInfo, in BuildNonArrayForRange()
2281 SemaRef.Diag(EndRange->getBeginLoc(), diag::note_in_for_range) in BuildNonArrayForRange()
2285 if (FinishForRangeVarDecl(SemaRef, EndVar, EndExpr->get(), ColonLoc, in BuildNonArrayForRange()
2287 NoteForRangeBeginEndFunction(SemaRef, EndExpr->get(), *BEF); in BuildNonArrayForRange()
2299 SemaRef.LookupQualifiedName(BeginMemberLookup, D); in BuildNonArrayForRange()
2303 SemaRef.LookupQualifiedName(EndMemberLookup, D); in BuildNonArrayForRange()
2329 SemaRef.PDiag(diag::err_for_range_invalid) in BuildNonArrayForRange()
2331 SemaRef, OCD_AllCandidates, BeginRange); in BuildNonArrayForRange()
2336 SemaRef.Diag(D->getLocation(), in BuildNonArrayForRange()
2363 static StmtResult RebuildForRangeWithDereference(Sema &SemaRef, Scope *S, in RebuildForRangeWithDereference() argument
2376 Sema::SFINAETrap Trap(SemaRef); in RebuildForRangeWithDereference()
2378 AdjustedRange = SemaRef.BuildUnaryOp(S, RangeLoc, UO_Deref, Range); in RebuildForRangeWithDereference()
2382 StmtResult SR = SemaRef.ActOnCXXForRangeStmt( in RebuildForRangeWithDereference()
2392 SemaRef.Diag(RangeLoc, diag::err_for_range_dereference) in RebuildForRangeWithDereference()
2394 return SemaRef.ActOnCXXForRangeStmt( in RebuildForRangeWithDereference()
2747 static void DiagnoseForRangeReferenceVariableCopies(Sema &SemaRef, in DiagnoseForRangeReferenceVariableCopies() argument
2786 ReferenceReturnType = SemaRef.Context.getLValueReferenceType(E->getType()); in DiagnoseForRangeReferenceVariableCopies()
2799 SemaRef.Diag(VD->getLocation(), in DiagnoseForRangeReferenceVariableCopies()
2805 SemaRef.Context.getLValueReferenceType(E->getType().withConst()); in DiagnoseForRangeReferenceVariableCopies()
2806 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_type_or_non_reference) in DiagnoseForRangeReferenceVariableCopies()
2814 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_ref_binds_ret_temp) in DiagnoseForRangeReferenceVariableCopies()
2818 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_non_reference_type) in DiagnoseForRangeReferenceVariableCopies()
2836 static void DiagnoseForRangeConstVariableCopies(Sema &SemaRef, in DiagnoseForRangeConstVariableCopies() argument
2857 ASTContext &Ctx = SemaRef.Context; in DiagnoseForRangeConstVariableCopies()
2865 SemaRef.Diag(VD->getLocation(), diag::warn_for_range_copy) in DiagnoseForRangeConstVariableCopies()
2867 SemaRef.Diag(VD->getBeginLoc(), diag::note_use_reference_type) in DiagnoseForRangeConstVariableCopies()
2868 << SemaRef.Context.getLValueReferenceType(VariableType) in DiagnoseForRangeConstVariableCopies()
2881 static void DiagnoseForRangeVariableCopies(Sema &SemaRef, in DiagnoseForRangeVariableCopies() argument
2883 if (SemaRef.inTemplateInstantiation()) in DiagnoseForRangeVariableCopies()
2886 if (SemaRef.Diags.isIgnored( in DiagnoseForRangeVariableCopies()
2889 SemaRef.Diags.isIgnored(diag::warn_for_range_ref_binds_ret_temp, in DiagnoseForRangeVariableCopies()
2891 SemaRef.Diags.isIgnored(diag::warn_for_range_copy, in DiagnoseForRangeVariableCopies()
2913 DiagnoseForRangeReferenceVariableCopies(SemaRef, VD, in DiagnoseForRangeVariableCopies()
2916 DiagnoseForRangeConstVariableCopies(SemaRef, VD); in DiagnoseForRangeVariableCopies()