================ @@ -1144,6 +1164,46 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +bool Sema::CheckFunctionConstraintsWithoutInstantiation( + SourceLocation PointOfInstantiation, FunctionTemplateDecl *Template, + ArrayRef<TemplateArgument> TemplateArgs, + ConstraintSatisfaction &Satisfaction) { + FunctionDecl *FD = Template->getTemplatedDecl(); + SmallVector<const Expr *, 3> TemplateAC; + Template->getAssociatedConstraints(TemplateAC); + if (TemplateAC.empty()) { + Satisfaction.IsSatisfied = true; + return false; + } + + // Enter the scope of this instantiation. We don't use + // PushDeclContext because we don't have a scope. + LocalInstantiationScope Scope(*this); ---------------- mizvekov wrote:
I am not sure how `PushDeclContext` is related to the instantiation scope. `PushDeclContext` would have changed the CurContext. If you need that, you can use `ContextRAII` https://github.com/llvm/llvm-project/pull/102857 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits