reader: Don't lose anonymous-ness of decl-only classes

When reading an anonymous declaration-only class from ABIXML
libabigail forgets to set the is-anonymous class.  This leads to
spurious change reports when comparing a binary against its ABIXML
representation.  Fixed thus.

Note that this doesn't yet impact any regression test but is useful
for a coming patch that will make abidw --abidiff to emit an error for
all ABI changes, not just the hard incompatible ones.  Without this
change, that coming patch will make runtestreaddwarf to fail.

	* src/abg-reader.cc (build_class_decl): Set the is-anonymous flag
	when reading a decl-only class.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2020-11-27 11:54:13 +01:00
parent a07fce3669
commit 5ae7de0cb6

View File

@ -4454,6 +4454,8 @@ build_class_decl(read_context& ctxt,
decl.reset(new class_decl(env, name, is_struct));
if (size_in_bits)
decl->set_size_in_bits(size_in_bits);
if (is_anonymous)
decl->set_is_anonymous(is_anonymous);
}
else
decl.reset(new class_decl(env, name, size_in_bits, alignment_in_bits,