Skip to content

Commit 39d0e41

Browse files
authored
[NFC][Clang Improve performance of DoMarkVarDeclReferenced (#161648)
Address post commit feedback from #161231
1 parent 8cf43ae commit 39d0e41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20107,9 +20107,10 @@ static void DoMarkVarDeclReferenced(
2010720107
bool NeededForConstantEvaluation =
2010820108
isPotentiallyConstantEvaluatedContext(SemaRef) && UsableInConstantExpr;
2010920109

20110-
bool NeedDefinition = OdrUse == OdrUseContext::Used ||
20111-
NeededForConstantEvaluation ||
20112-
Var->getType()->isUndeducedType();
20110+
bool NeedDefinition =
20111+
OdrUse == OdrUseContext::Used || NeededForConstantEvaluation ||
20112+
(TSK != clang::TSK_Undeclared && !UsableInConstantExpr &&
20113+
Var->getType()->isUndeducedType());
2011320114

2011420115
assert(!isa<VarTemplatePartialSpecializationDecl>(Var) &&
2011520116
"Can't instantiate a partial template specialization.");

0 commit comments

Comments
 (0)