@@ -335,9 +335,13 @@ exprt cpp_typecheck_resolvet::convert_identifier(
335
335
{
336
336
e.type ()=c_enum_tag_typet (symbol.name );
337
337
}
338
- else // will need to do struct, union
338
+ else if (symbol. type . id ()==ID_struct)
339
339
{
340
- e.type ()=symbol_typet (symbol.name );
340
+ e.type ()=struct_tag_typet (symbol.name );
341
+ }
342
+ else if (symbol.type .id ()==ID_union)
343
+ {
344
+ e.type ()=union_tag_typet (symbol.name );
341
345
}
342
346
}
343
347
else if (symbol.is_macro )
@@ -898,7 +902,7 @@ cpp_scopet &cpp_typecheck_resolvet::resolve_scope(
898
902
cpp_typecheck.cpp_scopes .current_scope ().print (std::cout);
899
903
std::cout << " X: " << id_set.size () << ' \n ' ;
900
904
#endif
901
- symbol_typet instance=
905
+ struct_tag_typet instance=
902
906
disambiguate_template_classes (final_base_name, id_set, template_args);
903
907
904
908
instance.add_source_location ()=source_location;
@@ -944,7 +948,7 @@ cpp_scopet &cpp_typecheck_resolvet::resolve_scope(
944
948
// the "::" triggers template elaboration
945
949
if (!cpp_typecheck.cpp_scopes .current_scope ().class_identifier .empty ())
946
950
{
947
- symbol_typet instance (
951
+ struct_tag_typet instance (
948
952
cpp_typecheck.cpp_scopes .current_scope ().class_identifier );
949
953
cpp_typecheck.elaborate_class_template (instance);
950
954
}
@@ -986,7 +990,7 @@ cpp_scopet &cpp_typecheck_resolvet::resolve_scope(
986
990
}
987
991
988
992
// / disambiguate partial specialization
989
- symbol_typet cpp_typecheck_resolvet::disambiguate_template_classes (
993
+ struct_tag_typet cpp_typecheck_resolvet::disambiguate_template_classes (
990
994
const irep_idt &base_name,
991
995
const cpp_scopest::id_sett &id_set,
992
996
const cpp_template_args_non_tct &full_template_args)
@@ -1182,7 +1186,7 @@ symbol_typet cpp_typecheck_resolvet::disambiguate_template_classes(
1182
1186
throw 0;
1183
1187
}
1184
1188
1185
- symbol_typet result(instance.name);
1189
+ struct_tag_typet result(instance.name);
1186
1190
result.add_source_location()=source_location;
1187
1191
1188
1192
return result;
@@ -1196,7 +1200,7 @@ symbol_typet cpp_typecheck_resolvet::disambiguate_template_classes(
1196
1200
match.specialization_args ,
1197
1201
match.full_args );
1198
1202
1199
- symbol_typet result (instance.name );
1203
+ struct_tag_typet result (instance.name );
1200
1204
result.add_source_location ()=source_location;
1201
1205
1202
1206
return result;
@@ -2062,7 +2066,7 @@ void cpp_typecheck_resolvet::apply_template_args(
2062
2066
template_args_tc,
2063
2067
template_args_tc);
2064
2068
2065
- expr=exprt (ID_type, symbol_typet (new_symbol.name ));
2069
+ expr=type_exprt ( struct_tag_typet (new_symbol.name ));
2066
2070
expr.add_source_location ()=source_location;
2067
2071
}
2068
2072
else
@@ -2207,11 +2211,7 @@ void cpp_typecheck_resolvet::filter_for_named_scopes(
2207
2211
assert (pcomp.get_bool (ID_is_type));
2208
2212
const typet &type=pcomp.type ();
2209
2213
assert (type.id ()!=ID_struct);
2210
-
2211
- if (type.id () == ID_symbol_type)
2212
- identifier = to_symbol_type (type).get_identifier ();
2213
- else
2214
- continue ;
2214
+ continue ;
2215
2215
}
2216
2216
2217
2217
while (true )
@@ -2230,8 +2230,6 @@ void cpp_typecheck_resolvet::filter_for_named_scopes(
2230
2230
new_set.insert (&class_id);
2231
2231
break ;
2232
2232
}
2233
- else if (symbol.type .id () == ID_symbol_type)
2234
- identifier = to_symbol_type (symbol.type ).get_identifier ();
2235
2233
else
2236
2234
break ;
2237
2235
}
0 commit comments