From 5ae7de0cb6406902421d30cb82cf3f8b3a926103 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 27 Nov 2020 11:54:13 +0100 Subject: [PATCH] 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 --- src/abg-reader.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/abg-reader.cc b/src/abg-reader.cc index e801f174..84e670df 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -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,