[06/11] ir: Support comparing a class_decl against a class_or_union
Commit Message
From: Dodji Seketeli <dodji@redhat.com>
When a class_decl is compared against a class_or_union type using
class_decl::operator==, that operator systematically fails. This
patch fixes that by comparing the common parts between the two
objects.
* src/abg-ir.cc (class_decl::operator==): Support comparing
against a class_or_union.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
src/abg-ir.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -25647,7 +25647,11 @@ class_decl::operator==(const decl_base& other) const
{
const class_decl* op = is_class_type(&other);
if (!op)
- return false;
+ {
+ if (class_or_union* cou = is_class_or_union_type(&other))
+ return class_or_union::operator==(*cou);
+ return false;
+ }
// If this is a decl-only type (and thus with no canonical type),
// use the canonical type of the definition, if any.