@@ -93,6 +93,9 @@ void c_typecheck_baset::typecheck_type(typet &type)
93
93
typecheck_symbol_type (to_symbol_type (type));
94
94
else if (type.id () == ID_typedef_type)
95
95
typecheck_typedef_type (type);
96
+ else if (type.id () == ID_union_tag)
97
+ {
98
+ }
96
99
else if (type.id ()==ID_vector)
97
100
typecheck_vector_type (to_vector_type (type));
98
101
else if (type.id ()==ID_custom_unsignedbv ||
@@ -795,12 +798,24 @@ void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type)
795
798
}
796
799
}
797
800
798
- symbol_typet symbol_type (identifier);
799
- symbol_type.add_source_location ()=type.source_location ();
801
+ if (type.id () == ID_union)
802
+ {
803
+ union_tag_typet tag_type (identifier);
804
+ tag_type.add_source_location () = type.source_location ();
805
+
806
+ c_qualifierst original_qualifiers (type);
807
+ type.swap (tag_type);
808
+ original_qualifiers.write (type);
809
+ }
810
+ else
811
+ {
812
+ symbol_typet symbol_type (identifier);
813
+ symbol_type.add_source_location () = type.source_location ();
800
814
801
- c_qualifierst original_qualifiers (type);
802
- type.swap (symbol_type);
803
- original_qualifiers.write (type);
815
+ c_qualifierst original_qualifiers (type);
816
+ type.swap (symbol_type);
817
+ original_qualifiers.write (type);
818
+ }
804
819
}
805
820
806
821
void c_typecheck_baset::typecheck_compound_body (
0 commit comments