File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -822,18 +822,17 @@ void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type)
822
822
823
823
c_qualifierst original_qualifiers (type);
824
824
825
- if (type. id () == ID_union)
826
- {
827
- union_tag_typet tag_type (identifier);
828
- tag_type. add_source_location () = type. source_location ( );
829
- type.swap (tag_type);
830
- }
825
+ typet tag_type;
826
+
827
+ if (type. id () == ID_union || type. id () == ID_incomplete_union)
828
+ tag_type = union_tag_typet (identifier );
829
+ else if (type. id () == ID_struct || type.id () == ID_incomplete_struct)
830
+ tag_type = struct_tag_typet (identifier);
831
831
else
832
- {
833
- symbol_typet symbol_type (identifier);
834
- symbol_type.add_source_location () = type.source_location ();
835
- type.swap (symbol_type);
836
- }
832
+ UNREACHABLE;
833
+
834
+ tag_type.add_source_location () = type.source_location ();
835
+ type.swap (tag_type);
837
836
838
837
original_qualifiers.write (type);
839
838
}
You can’t perform that action at this time.
0 commit comments