================
@@ -5284,8 +5284,22 @@ void Sema::InstantiateFunctionDefinition(SourceLocation 
PointOfInstantiation,
     savedContext.pop();
   }
 
-  DeclGroupRef DG(Function);
-  Consumer.HandleTopLevelDecl(DG);
+  // With CWG2369, we substitute constraints before instantiating the 
associated
+  // function template. This helps prevent potential code generation for
+  // dependent types, particularly under the MS ABI.
----------------
cor3ntin wrote:

```suggestion
  // We never need to emit the code for a lambda in unevaluated context.
  // We also can't mangle a lambda in the require clause of a function template 
  // during constraint checking as the MSI ABI would need to mangle the (not 
yet specialized) enclosing declaration
  // FIXME: Should we try to skip this for non-lambda functions too?
```

https://github.com/llvm/llvm-project/pull/122423
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to