forked from OSchip/llvm-project
More cleanup after removing the ability to reference a dependent
VarTemplateSpecializationDecl.
This commit is contained in:
parent
8d91ce8f58
commit
a4ca710d9c
|
@ -17925,8 +17925,6 @@ static void DoMarkVarDeclReferenced(Sema &SemaRef, SourceLocation Loc,
|
||||||
bool NeedDefinition =
|
bool NeedDefinition =
|
||||||
OdrUse == OdrUseContext::Used || NeededForConstantEvaluation;
|
OdrUse == OdrUseContext::Used || NeededForConstantEvaluation;
|
||||||
|
|
||||||
VarTemplateSpecializationDecl *VarSpec =
|
|
||||||
dyn_cast<VarTemplateSpecializationDecl>(Var);
|
|
||||||
assert(!isa<VarTemplatePartialSpecializationDecl>(Var) &&
|
assert(!isa<VarTemplatePartialSpecializationDecl>(Var) &&
|
||||||
"Can't instantiate a partial template specialization.");
|
"Can't instantiate a partial template specialization.");
|
||||||
|
|
||||||
|
@ -17961,30 +17959,21 @@ static void DoMarkVarDeclReferenced(Sema &SemaRef, SourceLocation Loc,
|
||||||
Var->setTemplateSpecializationKind(TSK, PointOfInstantiation);
|
Var->setTemplateSpecializationKind(TSK, PointOfInstantiation);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InstantiationDependent = false;
|
if (UsableInConstantExpr) {
|
||||||
bool IsNonDependent =
|
// Do not defer instantiations of variables that could be used in a
|
||||||
VarSpec ? !TemplateSpecializationType::anyDependentTemplateArguments(
|
// constant expression.
|
||||||
VarSpec->getTemplateArgsInfo(), InstantiationDependent)
|
SemaRef.runWithSufficientStackSpace(PointOfInstantiation, [&] {
|
||||||
: true;
|
SemaRef.InstantiateVariableDefinition(PointOfInstantiation, Var);
|
||||||
|
});
|
||||||
// Do not instantiate specializations that are still type-dependent.
|
} else if (FirstInstantiation ||
|
||||||
if (IsNonDependent) {
|
isa<VarTemplateSpecializationDecl>(Var)) {
|
||||||
if (UsableInConstantExpr) {
|
// FIXME: For a specialization of a variable template, we don't
|
||||||
// Do not defer instantiations of variables that could be used in a
|
// distinguish between "declaration and type implicitly instantiated"
|
||||||
// constant expression.
|
// and "implicit instantiation of definition requested", so we have
|
||||||
SemaRef.runWithSufficientStackSpace(PointOfInstantiation, [&] {
|
// no direct way to avoid enqueueing the pending instantiation
|
||||||
SemaRef.InstantiateVariableDefinition(PointOfInstantiation, Var);
|
// multiple times.
|
||||||
});
|
SemaRef.PendingInstantiations
|
||||||
} else if (FirstInstantiation ||
|
.push_back(std::make_pair(Var, PointOfInstantiation));
|
||||||
isa<VarTemplateSpecializationDecl>(Var)) {
|
|
||||||
// FIXME: For a specialization of a variable template, we don't
|
|
||||||
// distinguish between "declaration and type implicitly instantiated"
|
|
||||||
// and "implicit instantiation of definition requested", so we have
|
|
||||||
// no direct way to avoid enqueueing the pending instantiation
|
|
||||||
// multiple times.
|
|
||||||
SemaRef.PendingInstantiations
|
|
||||||
.push_back(std::make_pair(Var, PointOfInstantiation));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue