We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2542d0d commit 305c2b6Copy full SHA for 305c2b6
src/cpp/cpp_typecheck_compound_type.cpp
@@ -1458,9 +1458,14 @@ void cpp_typecheckt::convert_anon_struct_union_member(
1458
cpp_scopes.current_scope().prefix+
1459
base_name.c_str();
1460
1461
- const symbol_typet symbol_type(struct_union_symbol.name);
+ typet compound_type;
1462
1463
- struct_typet::componentt component(identifier, symbol_type);
+ if(struct_union_symbol.type.id() == ID_union)
1464
+ compound_type = union_tag_typet(struct_union_symbol.name);
1465
+ else
1466
+ compound_type = symbol_typet(struct_union_symbol.name);
1467
+
1468
+ struct_typet::componentt component(identifier, compound_type);
1469
component.set_access(access);
1470
component.set_base_name(base_name);
1471
component.set_pretty_name(base_name);
0 commit comments