When emitting abixml types inside a given scope are sorted
topologically. Types that don't have source definition location
information are sorted lexicographically.
There are certain types however that need more careful consideration.
Those are empty-qualified types. That is, qualified types (like
cv-qualified types) that carry no qualifier. The patch explains
in-extenso in comments where those types come from. You can also look
at the comments of the function maybe_strip_qualification for even
more context.
Simply put, an empty qualified type like 'NONE reference type' equals it's
non-qualified variant 'reference type'.
During the topological sorting, we chose to have the empty-qualified
variant "come before" (i.e, be "less than") the non-qualified variant.
This is alright.
The bug however is that we failed to handle the case were we are
looking at two empty-qualified types that are equal. In that case, of
course, they are meant to be topologically equivalent.
Fixed thus.
* src/abg-ir.cc (type_topo_comp::operator()): In the comparison
operator consider two equivalent empty-qualified types as being
topologically equivalent.