public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/95970] gcc/go/gofrontend/types.cc:1474:34: warning: ‘this’ pointer null
Date: Mon, 29 Jun 2020 17:33:05 +0000	[thread overview]
Message-ID: <bug-95970-4-hwipYxeAwh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95970-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95970

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
On second thought, I think the warning might be correct.  The function it's
issued for is a static member of class Type (I at first thought it was
virtual):

Expression*
Type::type_descriptor(Gogo* gogo, Type* type)
{
  return type->do_type_descriptor(gogo, NULL);   <<< -Wnonnull
}

and the call to it is below:

Expression*
Named_type::do_type_descriptor(Gogo* gogo, Named_type* name)
{
  if (this->is_error_)
    return Expression::make_error(this->location_);
  if (name == NULL && this->is_alias_)
    {
      if (this->seen_alias_)
        return Expression::make_error(this->location_);
      this->seen_alias_ = true;
      Expression* ret = this->type_->type_descriptor(gogo, NULL);   <<<
      this->seen_alias_ = false;
      return ret;
    }

I'll leave it to Ian to confirm one way or the other.

  parent reply	other threads:[~2020-06-29 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 16:00 [Bug bootstrap/95970] New: " msebor at gcc dot gnu.org
2020-06-29 16:49 ` [Bug bootstrap/95970] " jamborm at gcc dot gnu.org
2020-06-29 17:14 ` msebor at gcc dot gnu.org
2020-06-29 17:33 ` msebor at gcc dot gnu.org [this message]
2020-06-29 17:38 ` ian at airs dot com
2020-06-29 17:54 ` msebor at gcc dot gnu.org
2020-06-29 21:29 ` cvs-commit at gcc dot gnu.org
2020-06-29 21:34 ` ian at airs dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95970-4-hwipYxeAwh@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).