1
0
mirror of synced 2024-11-28 09:30:51 +01:00

patterns: Fixed copying of type decl nodes

This commit is contained in:
WerWolv 2022-03-24 18:00:00 +01:00
parent 95cf828975
commit a16e387dff

View File

@ -8,7 +8,7 @@ namespace hex::pl {
class ASTNodeTypeDecl : public ASTNode,
public Attributable {
public:
ASTNodeTypeDecl(std::string name) : m_forwardDeclared(true), m_name(name) { }
ASTNodeTypeDecl(std::string name) : m_forwardDeclared(true), m_name(std::move(name)) { }
ASTNodeTypeDecl(std::string name, std::shared_ptr<ASTNode> type, std::optional<std::endian> endian = std::nullopt)
: ASTNode(), m_name(std::move(name)), m_type(std::move(type)), m_endian(endian) { }
@ -17,6 +17,7 @@ namespace hex::pl {
this->m_name = other.m_name;
this->m_type = other.m_type;
this->m_endian = other.m_endian;
this->m_forwardDeclared = other.m_forwardDeclared;
}
[[nodiscard]] std::unique_ptr<ASTNode> clone() const override {