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)
822822
823823 c_qualifierst original_qualifiers (type);
824824
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);
831831 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);
837836
838837 original_qualifiers.write (type);
839838}
You can’t perform that action at this time.
0 commit comments