diff --git a/include/abg-ir.h b/include/abg-ir.h
index 3729e84a..b599ef3e 100644
--- a/include/abg-ir.h
+++ b/include/abg-ir.h
@@ -2813,6 +2813,10 @@ public:
   set_enum_type(enum_type_decl*);
 }; // end class enum_type_def::enumerator
 
+bool
+is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr,
+			      const enum_type_decl &enom);
+
 bool
 equals(const typedef_decl&, const typedef_decl&, change_kind*);
 
diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc
index 61fe89e0..1126ed58 100644
--- a/src/abg-comparison.cc
+++ b/src/abg-comparison.cc
@@ -14,6 +14,7 @@
 #include <libgen.h>
 #include <algorithm>
 #include <sstream>
+#include <set>
 
 #include "abg-comparison-priv.h"
 #include "abg-reporter-priv.h"
@@ -9619,6 +9620,81 @@ corpus_diff::priv::ensure_lookup_tables_populated()
 	      added_unreachable_types_[repr] = t;
 	  }
       }
+
+    // Handle anonymous enums that got changed.  An anonymous enum is
+    // designated by its flat textual representation. So a change to
+    // any of its enumerators results in a different enum.  That is
+    // represented by a deletion of the previous anonymous enum, and
+    // the addition of a new one.  For the user however, it's the same
+    // enum that changed.  Let's massage this "added/removed" pattern
+    // to show what the user expects, namely, a changed anonymous
+    // enum.
+    {
+      std::set<enum_type_decl_sptr> deleted_anon_enums;
+      std::set<enum_type_decl_sptr> added_anon_enums;
+
+      for (auto entry : deleted_unreachable_types_)
+	if (is_enum_type(entry.second)
+	    && is_enum_type(entry.second)->get_is_anonymous())
+	  deleted_anon_enums.insert(is_enum_type(entry.second));
+
+      for (auto entry : added_unreachable_types_)
+	if (is_enum_type(entry.second)
+	    && is_enum_type(entry.second)->get_is_anonymous())
+	  added_anon_enums.insert(is_enum_type(entry.second));
+
+      string_type_base_sptr_map added_anon_enum_to_erase;
+      string_type_base_sptr_map removed_anon_enum_to_erase;
+
+      // Look for deleted anonymous enums which have enumerators
+      // present in an added anonymous enums ...
+      for (auto deleted_enum : deleted_anon_enums)
+	{
+	  // Look for any enumerator of 'deleted_enum' that is also
+	  // present in an added anonymous enum.
+	  for (auto enr : deleted_enum->get_enumerators())
+	    {
+	      bool this_enum_got_changed = false;
+	      for (auto added_enum : added_anon_enums)
+		{
+		  if (is_enumerator_present_in_enum(enr, *added_enum))
+		    {
+		      // So the enumerator 'enr' from the
+		      // 'deleted_enum' enum is also present in the
+		      // 'added_enum' enum so we assume that
+		      // 'deleted_enum' and 'added_enum' are the same
+		      // enum that got changed.  Let's represent it
+		      // using a diff node.
+		      diff_sptr d = compute_diff(deleted_enum,
+						 added_enum, ctxt);
+		      ABG_ASSERT(d->has_changes());
+		      string repr =
+			abigail::ir::get_pretty_representation(is_type(deleted_enum),
+							       /*internal=*/false);
+		      changed_unreachable_types_[repr]= d;
+		      this_enum_got_changed = true;
+		      string r1 = abigail::ir::get_pretty_representation(is_type(deleted_enum));
+		      string r2 = abigail::ir::get_pretty_representation(is_type(added_enum));
+		      removed_anon_enum_to_erase[r1] = deleted_enum;
+		      added_anon_enum_to_erase[r2] = added_enum;
+		      break;
+		    }
+		}
+	      if (this_enum_got_changed)
+		break;
+	    }
+	}
+
+      // Now remove the added/removed anonymous enums from their maps,
+      // as they are now represented as a changed enum, not an added
+      // and removed enum.
+
+      for (auto entry : added_anon_enum_to_erase)
+	added_unreachable_types_.erase(entry.first);
+
+      for (auto entry : removed_anon_enum_to_erase)
+	deleted_unreachable_types_.erase(entry.first);
+    }
   }
 }
 
diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 06dfbe20..171267f8 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -18997,7 +18997,7 @@ enum_has_non_name_change(const enum_type_decl& l,
 ///
 /// @return true iff the enumerator @p enr is present in the enum @p
 /// enom.
-static bool
+bool
 is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr,
 			      const enum_type_decl &enom)
 {
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 1aa37b16..adb6d8bd 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -356,6 +356,12 @@ test-abidiff-exit/test-enumerator-changes1-v0.c \
 test-abidiff-exit/test-enumerator-changes1-v0.o \
 test-abidiff-exit/test-enumerator-changes1-v1.c \
 test-abidiff-exit/test-enumerator-changes1-v1.o \
+test-abidiff-exit/test-anonymous-enums-change-report-v0.txt \
+test-abidiff-exit/test-anonymous-enums-change-report-v1.txt \
+test-abidiff-exit/test-anonymous-enums-change-v0.c \
+test-abidiff-exit/test-anonymous-enums-change-v0.o \
+test-abidiff-exit/test-anonymous-enums-change-v1.c \
+test-abidiff-exit/test-anonymous-enums-change-v1.o \
 \
 test-diff-dwarf/test0-v0.cc		\
 test-diff-dwarf/test0-v0.o			\
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt
new file mode 100644
index 00000000..2a408ea0
--- /dev/null
+++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt
@@ -0,0 +1,16 @@
+Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+Unreachable types summary: 0 removed, 1 changed (1 filtered out), 1 added types
+
+1 changed type unreachable from any public interface:
+
+  [C] 'enum {E4_0=0, E4_1=1, E4_2=2, E4_LAST_ELEMENT=3, }' changed:
+    type size hasn't changed
+    2 enumerator deletions:
+      'E4_2' value '2'
+      'E4_LAST_ELEMENT' value '3'
+
+1 added type unreachable from any public interface:
+
+  [A] 'enum {E5_0=0, E5_1=1, }' at test-anonymous-enums-change-v1.c:26:1
+
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt
new file mode 100644
index 00000000..8639fa44
--- /dev/null
+++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt
@@ -0,0 +1,21 @@
+Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+Unreachable types summary: 0 removed, 2 changed, 1 added types
+
+2 changed types unreachable from any public interface:
+
+  [C] 'enum {E4_0=0, E4_1=1, E4_2=2, E4_LAST_ELEMENT=3, }' changed:
+    type size hasn't changed
+    2 enumerator deletions:
+      'E4_2' value '2'
+      'E4_LAST_ELEMENT' value '3'
+
+  [C] 'enum {E3_0=0, E3_1=1, }' changed:
+    type size hasn't changed
+    1 enumerator insertion:
+      'E3_2' value '2'
+
+1 added type unreachable from any public interface:
+
+  [A] 'enum {E5_0=0, E5_1=1, }' at test-anonymous-enums-change-v1.c:26:1
+
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c
new file mode 100644
index 00000000..443eb971
--- /dev/null
+++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c
@@ -0,0 +1,36 @@
+/*
+ *  Compile this with:
+ *    gcc -c -g -fno-eliminate-unused-debug-types test-anonymous-enums-change-v0.c 
+ */
+
+enum
+  {
+    E1_0,
+    E1_1,
+  } v1;
+
+enum
+  {
+    E3_0,
+    E3_1,
+  };
+
+enum
+  {
+    E4_0,
+    E4_1,
+    E4_2,
+    E4_LAST_ELEMENT
+  };
+
+enum
+  {
+    E0_0,
+    E0_1,
+  } v0;
+
+enum
+  {
+    E2_0,
+    E2_1,
+  } v2;
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o
new file mode 100644
index 0000000000000000000000000000000000000000..26c6df80f0d5203c520890f433cd5bba20b0bc4f
GIT binary patch
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c
--- /dev/null
+++ b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c
@@ -0,0 +1,41 @@
+/* 
+ * Compile this with:
+ *    gcc -c -g -fno-eliminate-unused-debug-types test-anonymous-enums-change-v1.c 
+ */
+
+enum
+  {
+    E1_0,
+    E1_1,
+  } v1;
+
+enum
+  {
+    E3_0,
+    E3_1,
+    E3_2
+  };
+
+enum
+  {
+    E4_0,
+    E4_1,
+  };
+
+enum
+  {
+    E5_0,
+    E5_1,
+  };
+
+enum
+  {
+    E0_0,
+    E0_1,
+  } v0;
+
+enum
+  {
+    E2_0,
+    E2_1,
+  } v2;
diff --git a/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o b/tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o
new file mode 100644
index 0000000000000000000000000000000000000000..7d0f71b47a47d0a7eb893ddd41c4515cfb4b28fa
GIT binary patch
diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc
--- a/tests/test-abidiff-exit.cc
+++ b/tests/test-abidiff-exit.cc
@@ -1032,6 +1032,38 @@ InOutSpec in_out_specs[] =
     "data/test-abidiff-exit/test-enumerator-changes1-report-1.txt",
     "output/test-abidiff-exit/test-enumerator-changes1-report-1.txt"
   },
+  {
+    "data/test-abidiff-exit/test-anonymous-enums-change-v0.o",
+    "data/test-abidiff-exit/test-anonymous-enums-change-v1.o",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "--no-default-suppression --non-reachable-types",
+    abigail::tools_utils::ABIDIFF_ABI_CHANGE
+    | abigail::tools_utils::ABIDIFF_ABI_INCOMPATIBLE_CHANGE,
+    "data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt",
+    "output/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt"
+  },
+  {
+    "data/test-abidiff-exit/test-anonymous-enums-change-v0.o",
+    "data/test-abidiff-exit/test-anonymous-enums-change-v1.o",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "",
+    "--no-default-suppression --harmless --non-reachable-types",
+    abigail::tools_utils::ABIDIFF_ABI_CHANGE
+    | abigail::tools_utils::ABIDIFF_ABI_INCOMPATIBLE_CHANGE,
+    "data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt",
+    "output/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt"
+  },
 #ifdef WITH_BTF
   {
     "data/test-abidiff-exit/btf/test0-v0.o",
