We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DoMarkVarDeclReferenced
1 parent 8cf43ae commit 39d0e41Copy full SHA for 39d0e41
clang/lib/Sema/SemaExpr.cpp
@@ -20107,9 +20107,10 @@ static void DoMarkVarDeclReferenced(
20107
bool NeededForConstantEvaluation =
20108
isPotentiallyConstantEvaluatedContext(SemaRef) && UsableInConstantExpr;
20109
20110
- bool NeedDefinition = OdrUse == OdrUseContext::Used ||
20111
- NeededForConstantEvaluation ||
20112
- Var->getType()->isUndeducedType();
+ bool NeedDefinition =
+ OdrUse == OdrUseContext::Used || NeededForConstantEvaluation ||
+ (TSK != clang::TSK_Undeclared && !UsableInConstantExpr &&
20113
+ Var->getType()->isUndeducedType());
20114
20115
assert(!isa<VarTemplatePartialSpecializationDecl>(Var) &&
20116
"Can't instantiate a partial template specialization.");
0 commit comments