[libcxx-commits] [clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 29 06:30:11 PDT 2024


================
@@ -3876,6 +3864,41 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
     FD = const_cast<FunctionDecl *>(FDFriend);
     Owner = FD->getLexicalDeclContext();
   }
+
+  // C++20 [temp.deduct.general]p5: [DR2369]
+  // If the function template has associated constraints, those constraints are
+  // checked for satisfaction. If the constraints are not satisfied, type
+  // deduction fails.
+  bool NeedConstraintChecking =
+      !PartialOverloading ||
+      CanonicalBuilder.size() ==
+          FunctionTemplate->getTemplateParameters()->size();
+  // FIXME: We haven't implemented DR2369 for lambdas yet, because we need
----------------
cor3ntin wrote:

```suggestion
  // FIXME: We haven't implemented CWG2369 for lambdas yet, because we need
```

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


More information about the libcxx-commits mailing list