[clang] [Clang] Reapply CWG2369 "Ordering between constraints and substitution" (PR #122423)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 26 01:39:05 PDT 2025


================
@@ -1921,9 +1956,62 @@ Decl *TemplateInstantiator::TransformDecl(SourceLocation Loc, Decl *D) {
     // template parameter.
   }
 
+  if (SemaRef.CurrentInstantiationScope) {
+    if (SemaRef.inConstraintSubstitution() && isa<ParmVarDecl>(D) &&
+        maybeInstantiateFunctionParameterToScope(cast<ParmVarDecl>(D)))
+      return nullptr;
+  }
----------------
cor3ntin wrote:

You can merge the two ifs

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


More information about the cfe-commits mailing list