[Bug bootstrap/95970] gcc/go/gofrontend/types.cc:1474:34: warning: ‘this’ pointer null
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 29 17:33:05 GMT 2020
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.
More information about the Gcc-bugs
mailing list