Skip to content

Commit c855b7b

Browse files
author
thk123
committed
Keep track of types for structs and unions
When dealing withs structs (and unions) we replace the type with a symbol for that type (that may or may not be new). However, if a struct is declared, we still need to track any qualifiers (e.g. a variable that is introduced as a const struct).
1 parent b5a205a commit c855b7b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ansi-c/c_typecheck_type.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,9 @@ void c_typecheck_baset::typecheck_compound_type(struct_union_typet &type)
820820
symbol_type.add_source_location()=type.source_location();
821821
symbol_type.set_identifier(identifier);
822822

823+
c_qualifierst original_qualifiers(type);
823824
type.swap(symbol_type);
825+
original_qualifiers.write(type);
824826
}
825827

826828
/*******************************************************************\

0 commit comments

Comments
 (0)