Lines Matching defs:SemaRef
124 getEnclosingTypeAliasTemplateDecl(Sema &SemaRef) {
125 for (auto &CSC : llvm::reverse(SemaRef.CodeSynthesisContexts)) {
269 Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function,
383 Response HandleRecordDecl(Sema &SemaRef, const CXXRecordDecl *Rec,
420 if (auto TypeAlias = getEnclosingTypeAliasTemplateDecl(SemaRef);
582 Sema &SemaRef, CodeSynthesisContext::SynthesisKind Kind,
586 : SemaRef(SemaRef) {
590 if (SemaRef.Diags.hasFatalErrorOccurred() &&
591 SemaRef.hasUncompilableErrorOccurred()) {
606 SemaRef.pushCodeSynthesisContext(Inst);
609 !SemaRef.InstantiatingSpecializations
612 atTemplateBegin(SemaRef.TemplateInstCallbacks, SemaRef, Inst);
617 Sema &SemaRef, SourceLocation PointOfInstantiation, Decl *Entity,
619 : InstantiatingTemplate(SemaRef,
624 Sema &SemaRef, SourceLocation PointOfInstantiation, FunctionDecl *Entity,
627 SemaRef, CodeSynthesisContext::ExceptionSpecInstantiation,
631 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateParameter Param,
635 SemaRef,
641 Sema &SemaRef, SourceLocation PointOfInstantiation,
646 : InstantiatingTemplate(SemaRef, Kind, PointOfInstantiation,
655 Sema &SemaRef, SourceLocation PointOfInstantiation,
660 SemaRef,
666 Sema &SemaRef, SourceLocation PointOfInstantiation,
671 SemaRef,
677 Sema &SemaRef, SourceLocation PointOfInstantiation,
682 SemaRef,
688 Sema &SemaRef, SourceLocation PointOfInstantiation, ParmVarDecl *Param,
691 SemaRef,
697 Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template,
701 SemaRef,
707 Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template,
711 SemaRef,
717 Sema &SemaRef, SourceLocation PointOfInstantiation,
721 SemaRef, CodeSynthesisContext::TypeAliasTemplateInstantiation,
726 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Template,
730 SemaRef, CodeSynthesisContext::DefaultTemplateArgumentChecking,
735 Sema &SemaRef, SourceLocation PointOfInstantiation,
739 SemaRef, CodeSynthesisContext::RequirementInstantiation,
745 Sema &SemaRef, SourceLocation PointOfInstantiation,
749 SemaRef, CodeSynthesisContext::NestedRequirementConstraintsCheck,
754 Sema &SemaRef, SourceLocation PointOfInstantiation, const RequiresExpr *RE,
757 SemaRef, CodeSynthesisContext::RequirementParameterInstantiation,
763 Sema &SemaRef, SourceLocation PointOfInstantiation,
767 SemaRef, CodeSynthesisContext::ConstraintsCheck,
772 Sema &SemaRef, SourceLocation PointOfInstantiation,
776 SemaRef, CodeSynthesisContext::ConstraintSubstitution,
781 Sema &SemaRef, SourceLocation PointOfInstantiation,
785 SemaRef, CodeSynthesisContext::ConstraintNormalization,
789 Sema &SemaRef, SourceLocation PointOfInstantiation,
793 SemaRef, CodeSynthesisContext::ParameterMappingSubstitution,
797 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Entity,
800 SemaRef, CodeSynthesisContext::BuildingDeductionGuides,
851 auto &Active = SemaRef.CodeSynthesisContexts.back();
853 SemaRef.InstantiatingSpecializations.erase(
857 atTemplateEnd(SemaRef.TemplateInstCallbacks, SemaRef,
858 SemaRef.CodeSynthesisContexts.back());
860 SemaRef.popCodeSynthesisContext();
881 assert(SemaRef.NonInstantiationEntries <=
882 SemaRef.CodeSynthesisContexts.size());
883 if ((SemaRef.CodeSynthesisContexts.size() -
884 SemaRef.NonInstantiationEntries)
885 <= SemaRef.getLangOpts().InstantiationDepth)
888 SemaRef.Diag(PointOfInstantiation,
890 << SemaRef.getLangOpts().InstantiationDepth
892 SemaRef.Diag(PointOfInstantiation, diag::note_template_recursion_depth)
893 << SemaRef.getLangOpts().InstantiationDepth;
1347 TemplateInstantiator(Sema &SemaRef,
1350 : inherited(SemaRef), TemplateArgs(TemplateArgs), Loc(Loc),
1405 SemaRef.CurrentInstantiationScope->MakeInstantiatedLocalArgPack(Pack);
1411 = SemaRef.CurrentInstantiationScope->getPartiallySubstitutedPack()){
1430 = SemaRef.CurrentInstantiationScope->getPartiallySubstitutedPack()){
1444 SemaRef.InstantiateAttrs(TemplateArgs, Old, New);
1449 SemaRef.CurrentInstantiationScope->MakeInstantiatedLocalArgPack(Old);
1451 SemaRef.CurrentInstantiationScope->InstantiatedLocalPackArg(
1474 SemaRef.CurrentInstantiationScope->InstantiatedLocal(Old, New);
1480 SemaRef.PerformDependentDiagnostics(DC, TemplateArgs);
1566 SemaRef.CodeSynthesisContexts.back().Kind ==
1573 TLB.pushTrivial(SemaRef.Context, Type, TL.getNameLoc());
1591 TemplateArgumentLoc Input = SemaRef.getTrivialTemplateArgumentLoc(
1594 if (SemaRef.SubstTemplateArgument(Input, TemplateArgs, Output))
1598 Output = SemaRef.getTrivialTemplateArgumentLoc(
1599 TemplateArgument(llvm::ArrayRef(TArgs).copy(SemaRef.Context)),
1659 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
1674 if (SemaRef.SubstDefaultArgument(EqualLoc, PVD, TemplateArgs)) {
1678 ExprResult ErrorResult = SemaRef.CreateRecoveryExpr(
1707 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
1715 Sema::SFINAETrap Trap(SemaRef);
1718 SemaRef.PerformDependentDiagnostics(E->getBody(), TemplateArgs);
1842 return SemaRef.FindInstantiatedDecl(Loc, cast<NamedDecl>(D), TemplateArgs);
1942 if (!SemaRef.isAcceptableTagRedeclaration(TD, Kind, /*isDefinition*/false,
1944 SemaRef.Diag(TagLocation, diag::err_use_with_wrong_tag)
1948 SemaRef.Diag(TD->getLocation(), diag::note_previous_use);
2081 QualType TargetType = SemaRef.SubstType(NTTP->getType(), TemplateArgs,
2087 QualType ExprType = TargetType.getNonLValueExprType(SemaRef.Context);
2091 return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(
2179 T = parm->getExpansionType(SemaRef.ArgumentPackSubstitutionIndex);
2184 return SemaRef.SubstType(T, TemplateArgs, loc, parm->getDeclName());
2222 result = SemaRef.BuildExpressionFromDeclTemplateArgument(arg, paramType, loc);
2226 result = SemaRef.BuildExpressionFromNonTypeTemplateArgument(arg, loc);
2229 SemaRef.Context.hasSameType(result.get()->getType(),
2238 return new (SemaRef.Context) SubstNonTypeTemplateParmExpr(
2291 if (SemaRef
2400 return SemaRef.BuildCXXDefaultArgExpr(
2412 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
2420 auto NewParm = SemaRef.SubstParmVarDecl(
2423 if (NewParm && SemaRef.getLangOpts().OpenCL)
2424 SemaRef.deduceOpenCLAddressSpace(NewParm);
2441 SemaRef.Context.getQualifiedType(Replacement.getUnqualifiedType(), RQs);
2445 TLB.pushTrivial(SemaRef.Context, Replacement, NameLoc);
2490 TLB.pushTrivial(SemaRef.Context, NewT, TL.getNameLoc());
2610 Sema::InstantiatingTemplate TypeInst(SemaRef, KWLoc,
2613 Sema::SFINAETrap Trap(SemaRef);
2625 SemaRef, Info, [&](llvm::raw_ostream &OS) { OS << *FailedDecl; })));
2645 Sema::SFINAETrap Trap(SemaRef);
2647 Sema::InstantiatingTemplate TypeInst(SemaRef,
2654 return RebuildTypeRequirement(createSubstDiag(SemaRef, Info,
2656 Req->getType()->getType().print(OS, SemaRef.getPrintingPolicy());
2666 Sema::SFINAETrap Trap(SemaRef);
2675 Sema::InstantiatingTemplate ExprInst(SemaRef, E->getBeginLoc(), Req, Info,
2682 TransExprRes = SemaRef.CheckPlaceholderExpr(TransExprRes.get());
2684 TransExpr = createSubstDiag(SemaRef, Info, [&](llvm::raw_ostream &OS) {
2685 E->printPretty(OS, nullptr, SemaRef.getPrintingPolicy());
2701 Sema::InstantiatingTemplate TPLInst(SemaRef, OrigTPL->getTemplateLoc(),
2707 TransRetReq.emplace(createSubstDiag(SemaRef, Info,
2710 ->printPretty(OS, nullptr, SemaRef.getPrintingPolicy());
2737 Sema::InstantiatingTemplate ReqInst(SemaRef,
2746 return new (SemaRef.Context)
2749 return new (SemaRef.Context) concepts::NestedRequirement(
2750 SemaRef.Context, TransConstraint.get(), Satisfaction);
2758 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
2759 Sema::SFINAETrap Trap(SemaRef);
2760 Sema::InstantiatingTemplate ConstrInst(SemaRef,
2766 if (!SemaRef.CheckConstraintSatisfaction(
2774 ASTContext &C = SemaRef.Context;
2783 SemaRef.getPrintingPolicy());
2785 SemaRef.Context, C.backupStr(Entity), Satisfaction);