writer: Fix emitting of some member types within their scope
When the canonical type of the scope type T of a member type MT
doesn't contain MT, then emitting T (obviously) doesn't emit MT. The
ABIXML writer detects that MT wasn't emitted, but then mistakenly
emits MT in the global scope, making MT lose its T scope.
When the ABIXML is read back again, MT mistakenly becomes a
non-qualified type, leading to a self-comparison error.
This issue appears when self-comparing gcc-gnat on fc36 on armv7hl at
least.
This patch fixes the issue by making write_decl_in_scope detect that
emitting T hasn't emitted MT. In that case, the function still needs
to emit the tags of the scope of MT and then emit MT.
* src/abg-writer.cc (write_decl_in_scope): Detect that emitting a
scope type T doesn't emit a particular member type MT that we are
looking at. In that case, the function still needs to emit the
tags of the scope of MT and then emit MT even though T was just
emitted.