[clang] [Clang] Instantiate variables referenced in `decltype` with an undeduced type. (PR #161231)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 2 03:17:16 PDT 2025


================
@@ -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();
----------------
cor3ntin wrote:

I just saw that, I'll make a PR

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


More information about the cfe-commits mailing list