if (!other)
return false;
- if (get_canonical_type() && other->get_canonical_type())
- return get_canonical_type().get() == other->get_canonical_type().get();
+ if (get_naked_canonical_type() && other->get_naked_canonical_type())
+ return get_naked_canonical_type() == other->get_naked_canonical_type();
return equals(*this, *other, 0);
}
if (get_naked_canonical_type() && other->get_naked_canonical_type())
return get_naked_canonical_type() == other->get_naked_canonical_type();
-
return equals(*this, *other, 0);
}
bool
function_type::operator==(const type_base& other) const
{
+ const function_type* o = dynamic_cast<const function_type*>(&other);
+ if (!o)
+ return false;
+
type_base* canonical_type = get_naked_canonical_type();
type_base* other_canonical_type = other.get_naked_canonical_type();
if (canonical_type && other_canonical_type)
return canonical_type == other_canonical_type;
- const function_type* o = dynamic_cast<const function_type*>(&other);
- if (!o)
- return false;
-
return equals(*this, *o, 0);
}
if (canonical_type && other_canonical_type)
return canonical_type == other_canonical_type;
- const class_or_union& o = *op;
- return equals(*this, o, 0);
+ return equals(*this, *op, 0);
}
/// Equality operator.
if (canonical_type && other_canonical_type)
return canonical_type == other_canonical_type;
- const class_decl& o = *op;
- return equals(*this, o, 0);
+ return equals(*this, *op, 0);
}
/// Equality operator for class_decl.
if (canonical_type && other_canonical_type)
return canonical_type == other_canonical_type;
- const union_decl &o = *op;
- return equals(*this, o, 0);
+ return equals(*this, *op, 0);
}
/// Equality operator for union_decl.