Lines Matching refs:SemaRef

718 static bool CheckConstexprParameterTypes(Sema &SemaRef,
728 SemaRef.RequireLiteralType(ParamLoc, *i,
816 static bool CheckConstexprDeclStmt(Sema &SemaRef, const FunctionDecl *Dcl,
842 SemaRef.Diag(TL.getBeginLoc(), diag::err_constexpr_vla)
854 SemaRef.Diag(DS->getLocStart(),
855 SemaRef.getLangOpts().CPlusPlus1y
875 SemaRef.Diag(VD->getLocation(),
882 SemaRef.RequireLiteralType(
889 SemaRef.Diag(VD->getLocation(),
895 SemaRef.Diag(VD->getLocation(),
896 SemaRef.getLangOpts().CPlusPlus1y
912 SemaRef.Diag(DS->getLocStart(), diag::err_constexpr_body_invalid_stmt)
929 static void CheckConstexprCtorInitializer(Sema &SemaRef,
951 SemaRef.Diag(Dcl->getLocation(), diag::err_constexpr_ctor_missing_init);
954 SemaRef.Diag(Field->getLocation(), diag::note_constexpr_ctor_missing_init);
961 CheckConstexprCtorInitializer(SemaRef, Dcl, I, Inits, Diagnosed);
968 CheckConstexprFunctionStmt(Sema &SemaRef, const FunctionDecl *Dcl, Stmt *S,
983 if (!CheckConstexprDeclStmt(SemaRef, Dcl, cast<DeclStmt>(S), Cxx1yLoc))
1006 if (!CheckConstexprFunctionStmt(SemaRef, Dcl, BodyIt, ReturnStmts,
1024 if (!CheckConstexprFunctionStmt(SemaRef, Dcl, If->getThen(), ReturnStmts,
1028 !CheckConstexprFunctionStmt(SemaRef, Dcl, If->getElse(), ReturnStmts,
1041 if (!SemaRef.getLangOpts().CPlusPlus1y)
1047 !CheckConstexprFunctionStmt(SemaRef, Dcl, *Children, ReturnStmts,
1062 !CheckConstexprFunctionStmt(SemaRef, Dcl, *Children, ReturnStmts,
1077 SemaRef.Diag(S->getLocStart(), diag::err_constexpr_body_invalid_stmt)
2370 Sema &SemaRef, const CXXConstructorDecl *Constructor) {
2372 if (SemaRef.getDiagnostics().isIgnored(diag::warn_field_is_uninit,
2398 SemaRef, InitExpr, UninitializedFields, Constructor);
2471 static bool FindBaseInitializer(Sema &SemaRef,
2479 if (SemaRef.Context.hasSameUnqualifiedType(BaseType, Base.getType())) {
2496 if (SemaRef.IsDerivedFrom(SemaRef.Context.getTypeDeclType(ClassDecl),
3037 static Expr *CastForMoving(Sema &SemaRef, Expr *E, QualType T = QualType()) {
3039 QualType TargetType = SemaRef.BuildReferenceType(
3042 TypeSourceInfo *TargetLoc = SemaRef.Context.getTrivialTypeSourceInfo(
3045 return SemaRef.BuildCXXNamedCast(ExprLoc, tok::kw_static_cast, TargetLoc, E,
3060 BuildImplicitBaseInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor,
3066 = InitializedEntity::InitializeBase(SemaRef.Context, BaseSpec,
3085 SemaRef.BuildDeclRefExpr(PD, PD->getType().getNonReferenceType(),
3089 Args.push_back(CastForMoving(SemaRef, ArgExpr.get(), PD->getType()));
3094 InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, Args);
3095 BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, Args);
3103 InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, None);
3104 BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, None);
3115 DeclRefExpr::Create(SemaRef.Context, NestedNameSpecifierLoc(),
3120 SemaRef.MarkDeclRefReferenced(cast<DeclRefExpr>(CopyCtorArg));
3124 SemaRef.Context.getQualifiedType(BaseSpec->getType().getUnqualifiedType(),
3128 CopyCtorArg = CastForMoving(SemaRef, CopyCtorArg);
3133 CopyCtorArg = SemaRef.ImpCastExprToType(CopyCtorArg, ArgTy,
3141 InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, CopyCtorArg);
3142 BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, CopyCtorArg);
3147 BaseInit = SemaRef.MaybeCreateExprWithCleanups(BaseInit);
3152 new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
3153 SemaRef.Context.getTrivialTypeSourceInfo(BaseSpec->getType(),
3170 BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor,
3185 if (Field->isBitField() && Field->getBitWidthValue(SemaRef.Context) == 0)
3189 DeclRefExpr::Create(SemaRef.Context, NestedNameSpecifierLoc(),
3193 SemaRef.MarkDeclRefReferenced(cast<DeclRefExpr>(MemberExprBase));
3196 MemberExprBase = CastForMoving(SemaRef, MemberExprBase);
3201 LookupResult MemberLookup(SemaRef, Field->getDeclName(), Loc,
3207 = SemaRef.BuildMemberReferenceExpr(MemberExprBase,
3222 CtorArg = CastForMoving(SemaRef, CtorArg.get());
3231 QualType SizeType = SemaRef.Context.getSizeType();
3234 = SemaRef.Context.getAsConstantArrayType(BaseType)) {
3242 IterationVarName = &SemaRef.Context.Idents.get(OS.str());
3245 = VarDecl::Create(SemaRef.Context, SemaRef.CurContext, Loc, Loc,
3247 SemaRef.Context.getTrivialTypeSourceInfo(SizeType, Loc),
3253 = SemaRef.BuildDeclRefExpr(IterationVar, SizeType, VK_LValue, Loc);
3256 IterationVarRef = SemaRef.DefaultLvalueConversion(IterationVarRef.get());
3261 CtorArg = SemaRef.CreateBuiltinArraySubscriptExpr(CtorArg.get(), Loc,
3272 CtorArg = CastForMoving(SemaRef, CtorArg.get());
3284 Entities.push_back(InitializedEntity::InitializeElement(SemaRef.Context,
3293 InitializationSequence InitSeq(SemaRef, Entities.back(), InitKind, CtorArgE);
3296 = InitSeq.Perform(SemaRef, Entities.back(), InitKind,
3298 MemberInit = SemaRef.MaybeCreateExprWithCleanups(MemberInit);
3306 = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Indirect,
3311 CXXMemberInit = CXXCtorInitializer::Create(SemaRef.Context, Field, Loc,
3323 SemaRef.Context.getBaseElementType(Field->getType());
3332 InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, None);
3334 InitSeq.Perform(SemaRef, InitEntity, InitKind, None);
3336 MemberInit = SemaRef.MaybeCreateExprWithCleanups(MemberInit);
3341 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
3347 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
3356 SemaRef.Diag(Constructor->getLocation(),
3359 << SemaRef.Context.getTagDeclType(Constructor->getParent())
3361 SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
3366 SemaRef.Diag(Constructor->getLocation(),
3369 << SemaRef.Context.getTagDeclType(Constructor->getParent())
3371 SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
3376 if (SemaRef.getLangOpts().ObjCAutoRefCount &&
3383 = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Field,
3385 new (SemaRef.Context) ImplicitValueInitExpr(Field->getType()),
3501 static bool CollectFieldInitializer(Sema &SemaRef, BaseAndFieldInfo &Info,
3528 Expr *DIE = CXXDefaultInitExpr::Create(SemaRef.Context,
3532 Init = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Indirect,
3537 Init = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Field,
3545 if (isIncompleteOrZeroLengthArrayType(SemaRef.Context, Field->getType()))
3786 Sema &SemaRef, const CXXConstructorDecl *Constructor,
3796 if (!SemaRef.Diags.isIgnored(diag::warn_initializer_out_of_order,
3814 IdealInitKeys.push_back(GetKeyForBase(SemaRef.Context, VBase.getType()));
3820 IdealInitKeys.push_back(GetKeyForBase(SemaRef.Context, Base.getType()));
3837 const void *InitKey = GetKeyForMember(SemaRef.Context, Init);
3850 SemaRef.Diag(PrevInit->getSourceLocation(),
8512 InheritingConstructorInfo(Sema &SemaRef, CXXRecordDecl *Derived)
8513 : SemaRef(SemaRef), Derived(Derived) {
8570 .getEntry(SemaRef, Ctor);
8604 SemaRef.Diag(UsingLoc, diag::warn_using_decl_constructor_ellipsis);
8605 SemaRef.Diag(Ctor->getLocation(),
8624 SemaRef.Context.getFunctionType(
8636 ASTContext &Context = SemaRef.Context;
8689 SemaRef.Diag(UsingLoc, diag::err_using_decl_constructor_conflict);
8690 SemaRef.Diag(BaseCtor->getLocation(),
8692 SemaRef.Diag(Entry.BaseCtor->getLocation(),
8694 SemaRef.Diag(Entry.DerivedCtor->getLocation(),
8700 SemaRef.SetDeclDeleted(Entry.DerivedCtor, UsingLoc);
8706 ASTContext &Context = SemaRef.Context;
8761 SemaRef.SetDeclDeleted(DerivedCtor, UsingLoc);
8766 FunctionTemplateDecl::Create(SemaRef.Context, Derived, UsingLoc, Name,
8779 Sema &SemaRef;
10835 CheckOperatorNewDeleteDeclarationScope(Sema &SemaRef,
10839 return SemaRef.Diag(FnDecl->getLocation(),
10846 return SemaRef.Diag(FnDecl->getLocation(),
10855 CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
10865 return SemaRef.Diag(FnDecl->getLocation(),
10870 if (SemaRef.Context.getCanonicalType(ResultType) != ExpectedResultType)
10871 return SemaRef.Diag(FnDecl->getLocation(),
10877 return SemaRef.Diag(FnDecl->getLocation(),
10883 return SemaRef.Diag(FnDecl->getLocation(),
10890 return SemaRef.Diag(FnDecl->getLocation(), DependentParamTypeDiag)
10894 if (SemaRef.Context.getCanonicalType(FirstParamType).getUnqualifiedType() !=
10896 return SemaRef.Diag(FnDecl->getLocation(), InvalidParamTypeDiag)
10903 CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) {
10908 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
10912 SemaRef.Context.getCanonicalType(SemaRef.Context.getSizeType());
10917 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,
10926 return SemaRef.Diag(FnDecl->getLocation(),
10934 CheckOperatorDeleteDeclaration(Sema &SemaRef, FunctionDecl *FnDecl) {
10939 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
10945 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidTy,
10946 SemaRef.Context.VoidPtrTy,