forked from OSchip/llvm-project
Fix "pointer is null" static analyzer warning. NFCI.
Remove Ctx null test as clang static analyzer assumes that this can fail - replace it with an assertion as the pointer is always dereferenced below.
This commit is contained in:
parent
591cd40584
commit
1d6b964ed1
|
@ -7386,7 +7386,8 @@ Sema::CheckTemplateDeclScope(Scope *S, TemplateParameterList *TemplateParams) {
|
|||
// C++ [temp]p4:
|
||||
// A template [...] shall not have C linkage.
|
||||
DeclContext *Ctx = S->getEntity();
|
||||
if (Ctx && Ctx->isExternCContext()) {
|
||||
assert(Ctx && "Unknown context");
|
||||
if (Ctx->isExternCContext()) {
|
||||
Diag(TemplateParams->getTemplateLoc(), diag::err_template_linkage)
|
||||
<< TemplateParams->getSourceRange();
|
||||
if (const LinkageSpecDecl *LSD = Ctx->getExternCContext())
|
||||
|
|
Loading…
Reference in New Issue