[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 07:07:32 PDT 2023


================
@@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S,
   llvm_unreachable("parameter index would not be produced from template");
 }
 
+// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl`
+// we try to instantiate and update its explicit specifier after constraint
+// checking.
+static Sema::TemplateDeductionResult
+tryInstantiateExplicitSpecifier(Sema &S, FunctionDecl *Specialization,
+                                const MultiLevelTemplateArgumentList &SubstArgs,
+                                TemplateDeductionInfo &Info,
+                                FunctionTemplateDecl *FunctionTemplate,
+                                ArrayRef<TemplateArgument> DeducedArgs) {
+
+  const auto TryInstantiateExplicitSpecifierForSingleDecl =
+      [&](auto *ExplicitDecl) {
----------------
erichkeane wrote:

This lambda is sufficiently large I think it needs to be its own static function. Please make it no longer a lambda.

https://github.com/llvm/llvm-project/pull/70548


More information about the cfe-commits mailing list