================
@@ -20108,8 +20108,9 @@ static void DoMarkVarDeclReferenced(
   bool NeededForConstantEvaluation =
       isPotentiallyConstantEvaluatedContext(SemaRef) && UsableInConstantExpr;
 
-  bool NeedDefinition =
-      OdrUse == OdrUseContext::Used || NeededForConstantEvaluation;
+  bool NeedDefinition = OdrUse == OdrUseContext::Used ||
+                        NeededForConstantEvaluation ||
+                        Var->getType()->isUndeducedType();
----------------
erichkeane wrote:

I actually wonder if this should be `isUndeducedAutoType`.  This ends up doing 
a type visitor to check if there is ANY 'auto' in the type 
(`GetContainedDeducedTypeVisitor`).

Do we expect this to work with an `auto*` return type to the lambda, etc?  I 
actually lean towards YES, but would love a test or two?

https://github.com/llvm/llvm-project/pull/161231
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to