if (diff_sptr d = underlying_type_diff())
{
RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(d, "pointed to type");
+ string repr = d->first_subject()
+ ? d->first_subject()->get_pretty_representation()
+ : string("void");
+
out << indent
- << "in pointed to type '"
- << d->first_subject()->get_pretty_representation()
- << "':\n";
+ << "in pointed to type '" << repr << "':\n";
d->report(out, indent + " ");
}
}
location locus)
: type_base(size_in_bits, align_in_bits),
decl_base("", locus, "",
- dynamic_pointer_cast<decl_base>(pointed_to)->get_visibility()),
+ pointed_to
+ ? get_type_declaration(pointed_to)->get_visibility()
+ : decl_base::VISIBILITY_DEFAULT),
pointed_to_type_(pointed_to)
{
try
{
decl_base_sptr pto = dynamic_pointer_cast<decl_base>(pointed_to);
- string name = pto->get_name() + "*";
+ string name = (pto ? pto->get_name() : string("void")) + "*";
set_name(name);
}
catch (...)
bool
equals(const pointer_type_def& l, const pointer_type_def& r, change_kind& k)
{
- bool result = (*l.get_pointed_to_type() == *r.get_pointed_to_type());
+ bool result = (l.get_pointed_to_type() == r.get_pointed_to_type());
if (!result)
k |= SUBTYPE_CHANGE_KIND;
decl_base_sptr td =
get_type_declaration(get_pointed_to_type());
string name;
- td->get_qualified_name(name);
+ if (!td)
+ name = "void";
+ else
+ td->get_qualified_name(name);
set_qualified_name(name + "*");
}
qn = peek_qualified_name();