Lines Matching defs:SemaRef
123 getEnclosingTypeAliasTemplateDecl(Sema &SemaRef) {
124 for (auto &CSC : llvm::reverse(SemaRef.CodeSynthesisContexts)) {
270 Response HandleFunction(Sema &SemaRef, const FunctionDecl *Function,
333 Response HandleFunctionTemplateDecl(Sema &SemaRef,
340 SemaRef.Context),
369 Arguments = CTD->getInjectedTemplateArgs(SemaRef.Context);
388 Response HandleRecordDecl(Sema &SemaRef, const CXXRecordDecl *Rec,
401 ClassTemplate->getInjectedTemplateArgs(SemaRef.Context),
426 if (auto TypeAlias = getEnclosingTypeAliasTemplateDecl(SemaRef);
589 Sema &SemaRef, CodeSynthesisContext::SynthesisKind Kind,
593 : SemaRef(SemaRef) {
597 if (SemaRef.Diags.hasFatalErrorOccurred() &&
598 SemaRef.hasUncompilableErrorOccurred()) {
613 SemaRef.pushCodeSynthesisContext(Inst);
616 !SemaRef.InstantiatingSpecializations
619 atTemplateBegin(SemaRef.TemplateInstCallbacks, SemaRef, Inst);
624 Sema &SemaRef, SourceLocation PointOfInstantiation, Decl *Entity,
626 : InstantiatingTemplate(SemaRef,
631 Sema &SemaRef, SourceLocation PointOfInstantiation, FunctionDecl *Entity,
634 SemaRef, CodeSynthesisContext::ExceptionSpecInstantiation,
638 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateParameter Param,
642 SemaRef,
648 Sema &SemaRef, SourceLocation PointOfInstantiation,
653 : InstantiatingTemplate(SemaRef, Kind, PointOfInstantiation,
662 Sema &SemaRef, SourceLocation PointOfInstantiation,
667 SemaRef,
673 Sema &SemaRef, SourceLocation PointOfInstantiation,
678 SemaRef,
684 Sema &SemaRef, SourceLocation PointOfInstantiation,
689 SemaRef,
695 Sema &SemaRef, SourceLocation PointOfInstantiation, ParmVarDecl *Param,
698 SemaRef,
704 Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template,
708 SemaRef,
714 Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template,
718 SemaRef,
724 Sema &SemaRef, SourceLocation PointOfInstantiation,
728 SemaRef, CodeSynthesisContext::TypeAliasTemplateInstantiation,
733 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Template,
737 SemaRef, CodeSynthesisContext::DefaultTemplateArgumentChecking,
742 Sema &SemaRef, SourceLocation PointOfInstantiation,
746 SemaRef, CodeSynthesisContext::RequirementInstantiation,
751 Sema &SemaRef, SourceLocation PointOfInstantiation,
755 SemaRef, CodeSynthesisContext::NestedRequirementConstraintsCheck,
760 Sema &SemaRef, SourceLocation PointOfInstantiation, const RequiresExpr *RE,
763 SemaRef, CodeSynthesisContext::RequirementParameterInstantiation,
768 Sema &SemaRef, SourceLocation PointOfInstantiation,
772 SemaRef, CodeSynthesisContext::ConstraintsCheck,
777 Sema &SemaRef, SourceLocation PointOfInstantiation,
781 SemaRef, CodeSynthesisContext::ConstraintSubstitution,
786 Sema &SemaRef, SourceLocation PointOfInstantiation,
790 SemaRef, CodeSynthesisContext::ConstraintNormalization,
794 Sema &SemaRef, SourceLocation PointOfInstantiation,
798 SemaRef, CodeSynthesisContext::ParameterMappingSubstitution,
802 Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Entity,
805 SemaRef, CodeSynthesisContext::BuildingDeductionGuides,
809 Sema &SemaRef, SourceLocation ArgLoc, PartialOrderingTTP,
811 : InstantiatingTemplate(SemaRef, CodeSynthesisContext::PartialOrderingTTP,
860 auto &Active = SemaRef.CodeSynthesisContexts.back();
862 SemaRef.InstantiatingSpecializations.erase(
866 atTemplateEnd(SemaRef.TemplateInstCallbacks, SemaRef,
867 SemaRef.CodeSynthesisContexts.back());
869 SemaRef.popCodeSynthesisContext();
890 assert(SemaRef.NonInstantiationEntries <=
891 SemaRef.CodeSynthesisContexts.size());
892 if ((SemaRef.CodeSynthesisContexts.size() -
893 SemaRef.NonInstantiationEntries)
894 <= SemaRef.getLangOpts().InstantiationDepth)
897 SemaRef.Diag(PointOfInstantiation,
899 << SemaRef.getLangOpts().InstantiationDepth
901 SemaRef.Diag(PointOfInstantiation, diag::note_template_recursion_depth)
902 << SemaRef.getLangOpts().InstantiationDepth;
1369 TemplateInstantiator(Sema &SemaRef,
1373 : inherited(SemaRef), TemplateArgs(TemplateArgs), Loc(Loc),
1431 SemaRef.CurrentInstantiationScope->MakeInstantiatedLocalArgPack(Pack);
1437 = SemaRef.CurrentInstantiationScope->getPartiallySubstitutedPack()){
1460 = SemaRef.CurrentInstantiationScope->getPartiallySubstitutedPack()){
1474 SemaRef.InstantiateAttrs(TemplateArgs, Old, New);
1480 SemaRef.CurrentInstantiationScope->MakeInstantiatedLocalArgPack(Old);
1482 SemaRef.CurrentInstantiationScope->InstantiatedLocalPackArg(
1505 SemaRef.CurrentInstantiationScope->InstantiatedLocal(Old, New);
1511 SemaRef.PerformDependentDiagnostics(DC, TemplateArgs);
1602 SemaRef.CodeSynthesisContexts.back().Kind ==
1609 TLB.pushTrivial(SemaRef.Context, Type, TL.getNameLoc());
1627 TemplateArgumentLoc Input = SemaRef.getTrivialTemplateArgumentLoc(
1630 if (SemaRef.SubstTemplateArgument(Input, TemplateArgs, Output))
1634 Output = SemaRef.getTrivialTemplateArgumentLoc(
1635 TemplateArgument(llvm::ArrayRef(TArgs).copy(SemaRef.Context)),
1690 SemaRef, TA.pack_size() - 1 - *Type->getPackIndex());
1715 if (SemaRef.RebuildingImmediateInvocation)
1717 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true,
1725 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true,
1740 if (SemaRef.SubstDefaultArgument(EqualLoc, PVD, TemplateArgs)) {
1744 ExprResult ErrorResult = SemaRef.CreateRecoveryExpr(
1769 LocalInstantiationScope Scope(SemaRef, /*CombineWithOuterScope=*/true);
1777 Sema::SFINAETrap Trap(SemaRef);
1780 SemaRef.PerformDependentDiagnostics(E->getBody(), TemplateArgs);
1907 return SemaRef.FindInstantiatedDecl(Loc, cast<NamedDecl>(D), TemplateArgs);
2007 if (!SemaRef.isAcceptableTagRedeclaration(TD, Kind, /*isDefinition*/false,
2009 SemaRef.Diag(TagLocation, diag::err_use_with_wrong_tag)
2013 SemaRef.Diag(TD->getLocation(), diag::note_previous_use);
2150 QualType TargetType = SemaRef.SubstType(NTTP->getType(), TemplateArgs,
2156 QualType ExprType = TargetType.getNonLValueExprType(SemaRef.Context);
2160 return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(
2267 T = parm->getExpansionType(SemaRef.ArgumentPackSubstitutionIndex);
2272 return SemaRef.SubstType(T, TemplateArgs, loc, parm->getDeclName());
2310 result = SemaRef.BuildExpressionFromDeclTemplateArgument(arg, paramType, loc);
2314 result = SemaRef.BuildExpressionFromNonTypeTemplateArgument(arg, loc);
2317 SemaRef.Context.hasSameType(result.get()->getType(),
2326 return new (SemaRef.Context) SubstNonTypeTemplateParmExpr(
2379 if (SemaRef
2498 return SemaRef.BuildCXXDefaultArgExpr(
2519 Scope.emplace(SemaRef, /*CombineWithOuterScope=*/true);
2528 auto NewParm = SemaRef.SubstParmVarDecl(
2531 if (NewParm && SemaRef.getLangOpts().OpenCL)
2532 SemaRef.deduceOpenCLAddressSpace(NewParm);
2549 SemaRef.Context.getQualifiedType(Replacement.getUnqualifiedType(), RQs);
2553 TLB.pushTrivial(SemaRef.Context, Replacement, NameLoc);
2602 TLB.pushTrivial(SemaRef.Context, NewT, TL.getNameLoc());
2734 Sema::InstantiatingTemplate TypeInst(SemaRef, KWLoc,
2737 Sema::SFINAETrap Trap(SemaRef);
2749 SemaRef, Info, [&](llvm::raw_ostream &OS) { OS << *FailedDecl; })));
2769 Sema::SFINAETrap Trap(SemaRef);
2771 Sema::InstantiatingTemplate TypeInst(SemaRef,
2778 return RebuildTypeRequirement(createSubstDiag(SemaRef, Info,
2780 Req->getType()->getType().print(OS, SemaRef.getPrintingPolicy());
2790 Sema::SFINAETrap Trap(SemaRef);
2799 Sema::InstantiatingTemplate ExprInst(SemaRef, E->getBeginLoc(), Req, Info,
2806 TransExprRes = SemaRef.CheckPlaceholderExpr(TransExprRes.get());
2808 TransExpr = createSubstDiag(SemaRef, Info, [&](llvm::raw_ostream &OS) {
2809 E->printPretty(OS, nullptr, SemaRef.getPrintingPolicy());
2825 Sema::InstantiatingTemplate TPLInst(SemaRef, OrigTPL->getTemplateLoc(),
2831 TransRetReq.emplace(createSubstDiag(SemaRef, Info,
2834 ->printPretty(OS, nullptr, SemaRef.getPrintingPolicy());
2861 Sema::InstantiatingTemplate ReqInst(SemaRef,
2870 return new (SemaRef.Context)
2873 return new (SemaRef.Context) concepts::NestedRequirement(
2874 SemaRef.Context, TransConstraint.get(), Satisfaction);
2882 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
2883 Sema::SFINAETrap Trap(SemaRef);
2884 Sema::InstantiatingTemplate ConstrInst(SemaRef,
2890 if (!SemaRef.CheckConstraintSatisfaction(
2898 ASTContext &C = SemaRef.Context;
2907 SemaRef.getPrintingPolicy());
2909 SemaRef.Context, C.backupStr(Entity), Satisfaction);
3176 Sema &SemaRef, const MultiLevelTemplateArgumentList &TemplateArgs)
3177 : inherited(SemaRef), TemplateArgs(TemplateArgs) {}
3191 assert(SemaRef.ArgumentPackSubstitutionIndex != -1);
3197 PackIndex = Arg.pack_size() - 1 - SemaRef.ArgumentPackSubstitutionIndex;
3199 QualType Result = SemaRef.Context.getSubstTemplateTypeParmType(