TableType: Convert table_hash unique_ptr

Cannot remove the destructor as otherwise the compiler attempts to create
its implementation in Type.h where CompositeHash isn't a complete type
yet and std::unique_ptr's delete fails to be instantiated.
This commit is contained in:
Arne Welzel 2023-12-15 10:17:06 +01:00
parent a11ee9038b
commit be0a22fec2
2 changed files with 5 additions and 7 deletions

View file

@ -4,6 +4,7 @@
#include <list>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
@ -402,7 +403,7 @@ public:
// what one gets using an empty "set()" or "table()" constructor.
bool IsUnspecifiedTable() const;
const detail::CompositeHash* GetTableHash() const { return table_hash; }
const detail::CompositeHash* GetTableHash() const { return table_hash.get(); }
// Called to rebuild the associated hash function when a record type
// (that this table type depends on) gets redefined during parsing.
@ -411,7 +412,7 @@ public:
private:
bool DoExpireCheck(const detail::AttrPtr& attr);
detail::CompositeHash* table_hash = nullptr;
std::unique_ptr<detail::CompositeHash> table_hash;
// Used to prevent repeated error messages.
bool reported_error = false;