@@ -24,7 +24,7 @@ class Field : public TypeAndName {
2424 uint64_t offsetInBits = 0 ;
2525};
2626
27- class StructOrUnion {
27+ class StructOrUnion : public virtual Type {
2828 public:
2929 StructOrUnion (std::string name, std::vector<std::shared_ptr<Field>> fields,
3030 std::shared_ptr<Location> location);
@@ -47,9 +47,7 @@ class StructOrUnion {
4747 std::shared_ptr<Location> location;
4848};
4949
50- class Struct : public StructOrUnion ,
51- public Type,
52- public std::enable_shared_from_this<Struct> {
50+ class Struct : public StructOrUnion {
5351 public:
5452 Struct (std::string name, std::vector<std::shared_ptr<Field>> fields,
5553 uint64_t typeSize, std::shared_ptr<Location> location, bool isPacked,
@@ -103,9 +101,7 @@ class Struct : public StructOrUnion,
103101 std::string generateGetterForArrayRepresentation (unsigned fieldIndex) const ;
104102};
105103
106- class Union : public StructOrUnion ,
107- public ArrayType,
108- public std::enable_shared_from_this<Union> {
104+ class Union : public StructOrUnion , public ArrayType {
109105 public:
110106 Union (std::string name, std::vector<std::shared_ptr<Field>> fields,
111107 uint64_t maxSize, std::shared_ptr<Location> location);
0 commit comments