File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -800,12 +800,24 @@ void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type)
800
800
}
801
801
}
802
802
803
- symbol_typet symbol_type (identifier);
804
- symbol_type.add_source_location ()=type.source_location ();
803
+ if (type.id () == ID_union)
804
+ {
805
+ union_tag_typet tag_type (identifier);
806
+ tag_type.add_source_location () = type.source_location ();
807
+
808
+ c_qualifierst original_qualifiers (type);
809
+ type.swap (tag_type);
810
+ original_qualifiers.write (type);
811
+ }
812
+ else
813
+ {
814
+ symbol_typet symbol_type (identifier);
815
+ symbol_type.add_source_location () = type.source_location ();
805
816
806
- c_qualifierst original_qualifiers (type);
807
- type.swap (symbol_type);
808
- original_qualifiers.write (type);
817
+ c_qualifierst original_qualifiers (type);
818
+ type.swap (symbol_type);
819
+ original_qualifiers.write (type);
820
+ }
809
821
}
810
822
811
823
void c_typecheck_baset::typecheck_compound_body (
You can’t perform that action at this time.
0 commit comments