Commit 1d6b964e authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

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.
parent 591cd405
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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())