diff mbox series

[3/6] reader: Don't lose anonymous-ness of decl-only classes

Message ID 874kla7mqq.fsf@redhat.com
State Committed
Headers show
Series Fix subtle ABI artifact representation issues | expand

Commit Message

Dodji Seketeli Nov. 27, 2020, 5:06 p.m. UTC

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>

Applied to master.

 src/abg-reader.cc | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series


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)
+	  if (is_anonymous)
+	    decl->set_is_anonymous(is_anonymous);
 	decl.reset(new class_decl(env, name, size_in_bits, alignment_in_bits,