if (!force_delay
&& !type_has_non_canonicalized_subtype(t)
&& !is_class_type(t)
+ && !is_union_type(t)
&& !is_wip_type(t)
// Below are types that *must* be canonicalized only after
// they are added to their context; but then this function
ABG_ASSERT(!id.empty());
class_decl_sptr previous_definition, previous_declaration;
- const vector<type_base_sptr> *types_ptr = ctxt.get_all_type_decls(id);
+ const vector<type_base_sptr> *types_ptr = 0;
+ if (!is_anonymous)
+ types_ptr = ctxt.get_all_type_decls(id);
if (types_ptr)
{
// Lets look at the previous declarations and the first previous
ABG_ASSERT(!id.empty());
union_decl_sptr previous_definition, previous_declaration;
- const vector<type_base_sptr> *types_ptr = ctxt.get_all_type_decls(id);
+ const vector<type_base_sptr> *types_ptr = 0;
+ if (!is_anonymous)
+ types_ptr = ctxt.get_all_type_decls(id);
if (types_ptr)
{
// Lets look at the previous declarations and the first previous