forked from OSchip/llvm-project
Fix "pointer is null" static analyzer warning. NFCI.
This commit is contained in:
parent
60e0120c91
commit
3b417b7cf7
|
@ -379,11 +379,11 @@ StringRef TParamCommandComment::getParamName(const FullComment *FC) const {
|
||||||
assert(isPositionValid());
|
assert(isPositionValid());
|
||||||
const TemplateParameterList *TPL = FC->getDeclInfo()->TemplateParameters;
|
const TemplateParameterList *TPL = FC->getDeclInfo()->TemplateParameters;
|
||||||
for (unsigned i = 0, e = getDepth(); i != e; ++i) {
|
for (unsigned i = 0, e = getDepth(); i != e; ++i) {
|
||||||
if (i == e-1)
|
assert(TPL && "Unknown TemplateParameterList");
|
||||||
|
if (i == e - 1)
|
||||||
return TPL->getParam(getIndex(i))->getName();
|
return TPL->getParam(getIndex(i))->getName();
|
||||||
const NamedDecl *Param = TPL->getParam(getIndex(i));
|
const NamedDecl *Param = TPL->getParam(getIndex(i));
|
||||||
if (const TemplateTemplateParmDecl *TTP =
|
if (auto *TTP = dyn_cast<TemplateTemplateParmDecl>(Param))
|
||||||
dyn_cast<TemplateTemplateParmDecl>(Param))
|
|
||||||
TPL = TTP->getTemplateParameters();
|
TPL = TTP->getTemplateParameters();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in New Issue