From 665804df115ef5d11b1489cc73b4b845fed51870 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 21 Oct 2024 13:25:09 +0800 Subject: [PATCH] abstract class's destructor should be virtualed (#709) Signed-off-by: Junwang Zhao --- .../geax-front-end/include/geax-front-end/ast/clause/EdgeLike.h | 2 +- .../include/geax-front-end/ast/clause/ElementPredicate.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/clause/Hint.h | 2 +- .../include/geax-front-end/ast/clause/LabelTree.h | 2 +- .../include/geax-front-end/ast/clause/PathPrefix.h | 2 +- .../include/geax-front-end/ast/clause/QueryConjunctionType.h | 2 +- .../include/geax-front-end/ast/clause/RemoveItem.h | 2 +- .../include/geax-front-end/ast/clause/SchemaRef.h | 2 +- .../include/geax-front-end/ast/clause/SessionResetCommand.h | 2 +- .../include/geax-front-end/ast/clause/SessionSetCommand.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/clause/SetItem.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/expr/BinaryOp.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/expr/Expr.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/expr/Literal.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/expr/UnaryOp.h | 2 +- .../include/geax-front-end/ast/stmt/BindingDefinition.h | 2 +- .../include/geax-front-end/ast/stmt/BindingTableExpr.h | 2 +- .../include/geax-front-end/ast/stmt/EndTransaction.h | 2 +- .../include/geax-front-end/ast/stmt/LinearQueryStatement.h | 2 +- .../geax-front-end/ast/stmt/PrimitiveDataModifyStatement.h | 2 +- .../include/geax-front-end/ast/stmt/ProcedureCall.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/stmt/Session.h | 2 +- .../include/geax-front-end/ast/stmt/SimpleQueryStatement.h | 2 +- deps/geax-front-end/include/geax-front-end/ast/stmt/Statement.h | 2 +- .../include/geax-front-end/ast/stmt/Transaction.h | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/EdgeLike.h b/deps/geax-front-end/include/geax-front-end/ast/clause/EdgeLike.h index 62c5343371..855557268b 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/EdgeLike.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/EdgeLike.h @@ -26,7 +26,7 @@ namespace frontend { class EdgeLike : public AstNode { public: explicit EdgeLike(AstNodeType type) : AstNode(type) {} - ~EdgeLike() = default; + virtual ~EdgeLike() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/ElementPredicate.h b/deps/geax-front-end/include/geax-front-end/ast/clause/ElementPredicate.h index e4afca1ccd..bba4871afb 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/ElementPredicate.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/ElementPredicate.h @@ -26,7 +26,7 @@ namespace frontend { class ElementPredicate : public AstNode { public: explicit ElementPredicate(AstNodeType type) : AstNode(type) {} - ~ElementPredicate() = default; + virtual ~ElementPredicate() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/Hint.h b/deps/geax-front-end/include/geax-front-end/ast/clause/Hint.h index 2049c5b381..3d8e04a1a4 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/Hint.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/Hint.h @@ -26,7 +26,7 @@ namespace frontend { class Hint : public AstNode { public: explicit Hint(AstNodeType type) : AstNode(type) {} - ~Hint() = default; + virtual ~Hint() = default; }; // class Hint } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/LabelTree.h b/deps/geax-front-end/include/geax-front-end/ast/clause/LabelTree.h index d2fdef52ca..52464682f5 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/LabelTree.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/LabelTree.h @@ -26,7 +26,7 @@ namespace frontend { class LabelTree : public AstNode { public: explicit LabelTree(AstNodeType type) : AstNode(type) {} - ~LabelTree() = default; + virtual ~LabelTree() = default; friend bool operator==(const LabelTree& lhs, const LabelTree& rhs) { return lhs.type() == rhs.type() && lhs.equals(rhs); diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/PathPrefix.h b/deps/geax-front-end/include/geax-front-end/ast/clause/PathPrefix.h index 74610c8aa5..82925a434d 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/PathPrefix.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/PathPrefix.h @@ -26,7 +26,7 @@ namespace frontend { class PathPrefix : public AstNode { public: explicit PathPrefix(AstNodeType type) : AstNode(type) {} - ~PathPrefix() = default; + virtual ~PathPrefix() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/QueryConjunctionType.h b/deps/geax-front-end/include/geax-front-end/ast/clause/QueryConjunctionType.h index 35c1be1d3c..257179cefa 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/QueryConjunctionType.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/QueryConjunctionType.h @@ -26,7 +26,7 @@ namespace frontend { class QueryConjunctionType : public AstNode { public: explicit QueryConjunctionType(AstNodeType nodeType) : AstNode(nodeType) {} - ~QueryConjunctionType() = default; + virtual ~QueryConjunctionType() = default; }; // class QueryConjunctionType } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/RemoveItem.h b/deps/geax-front-end/include/geax-front-end/ast/clause/RemoveItem.h index a4872a7888..2839ce2f89 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/RemoveItem.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/RemoveItem.h @@ -13,7 +13,7 @@ namespace frontend { class RemoveItem : public AstNode { public: explicit RemoveItem(AstNodeType type) : AstNode(type) {} - ~RemoveItem() = default; + virtual ~RemoveItem() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/SchemaRef.h b/deps/geax-front-end/include/geax-front-end/ast/clause/SchemaRef.h index 2b155f5767..6792a6e122 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/SchemaRef.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/SchemaRef.h @@ -26,7 +26,7 @@ namespace frontend { class SchemaRef : public AstNode { public: explicit SchemaRef(AstNodeType nodeType) : AstNode(nodeType) {} - ~SchemaRef() = default; + virtual ~SchemaRef() = default; }; // class SchemaRef } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/SessionResetCommand.h b/deps/geax-front-end/include/geax-front-end/ast/clause/SessionResetCommand.h index 80cc90a3b6..02a9926457 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/SessionResetCommand.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/SessionResetCommand.h @@ -26,7 +26,7 @@ namespace frontend { class SessionResetCommand : public AstNode { public: explicit SessionResetCommand(AstNodeType type) : AstNode(type) {} - ~SessionResetCommand() = default; + virtual ~SessionResetCommand() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/SessionSetCommand.h b/deps/geax-front-end/include/geax-front-end/ast/clause/SessionSetCommand.h index ded3949c28..49839c8d75 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/SessionSetCommand.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/SessionSetCommand.h @@ -26,7 +26,7 @@ namespace frontend { class SessionSetCommand : public AstNode { public: explicit SessionSetCommand(AstNodeType type) : AstNode(type) {} - ~SessionSetCommand() = default; + virtual ~SessionSetCommand() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/clause/SetItem.h b/deps/geax-front-end/include/geax-front-end/ast/clause/SetItem.h index 7a886e0900..f8819cd708 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/clause/SetItem.h +++ b/deps/geax-front-end/include/geax-front-end/ast/clause/SetItem.h @@ -26,7 +26,7 @@ namespace frontend { class SetItem : public AstNode { public: explicit SetItem(AstNodeType type) : AstNode(type) {} - ~SetItem() = default; + virtual ~SetItem() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/expr/BinaryOp.h b/deps/geax-front-end/include/geax-front-end/ast/expr/BinaryOp.h index 584649b011..2739a280cc 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/expr/BinaryOp.h +++ b/deps/geax-front-end/include/geax-front-end/ast/expr/BinaryOp.h @@ -26,7 +26,7 @@ namespace frontend { class BinaryOp : public Expr { public: explicit BinaryOp(AstNodeType type) : Expr(type), left_(nullptr), right_(nullptr) {} - ~BinaryOp() = default; + virtual ~BinaryOp() = default; void setLeft(Expr* left) { left_ = left; } Expr* left() const { return left_; } diff --git a/deps/geax-front-end/include/geax-front-end/ast/expr/Expr.h b/deps/geax-front-end/include/geax-front-end/ast/expr/Expr.h index 51d04789ff..36e66f7d02 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/expr/Expr.h +++ b/deps/geax-front-end/include/geax-front-end/ast/expr/Expr.h @@ -31,7 +31,7 @@ class GQLExpr; class Expr : public AstNode { public: explicit Expr(AstNodeType type) : AstNode(type) {} - ~Expr() = default; + virtual ~Expr() = default; friend bool operator==(const Expr& lhs, const Expr& rhs) { return lhs.type() == rhs.type() && lhs.equals(rhs); diff --git a/deps/geax-front-end/include/geax-front-end/ast/expr/Literal.h b/deps/geax-front-end/include/geax-front-end/ast/expr/Literal.h index abd3eba72a..13e1aa210e 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/expr/Literal.h +++ b/deps/geax-front-end/include/geax-front-end/ast/expr/Literal.h @@ -26,7 +26,7 @@ namespace frontend { class Literal : public Expr { public: explicit Literal(AstNodeType type) : Expr(type) {} - ~Literal() = default; + virtual ~Literal() = default; }; // class Literal } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/expr/UnaryOp.h b/deps/geax-front-end/include/geax-front-end/ast/expr/UnaryOp.h index c158d6251b..03a199dbfb 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/expr/UnaryOp.h +++ b/deps/geax-front-end/include/geax-front-end/ast/expr/UnaryOp.h @@ -26,7 +26,7 @@ namespace frontend { class UnaryOp : public Expr { public: explicit UnaryOp(AstNodeType type) : Expr(type), expr_(nullptr) {} - ~UnaryOp() = default; + virtual ~UnaryOp() = default; void setExpr(Expr* expr) { expr_ = expr; } Expr* expr() const { return expr_; } diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingDefinition.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingDefinition.h index 35c6fd3348..7c4ed039c9 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingDefinition.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingDefinition.h @@ -26,7 +26,7 @@ namespace frontend { class BindingDefinition : public AstNode { public: explicit BindingDefinition(AstNodeType nodeType) : AstNode(nodeType) {} - ~BindingDefinition() = default; + virtual ~BindingDefinition() = default; }; // class BindingDefinition } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingTableExpr.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingTableExpr.h index cdff84fe53..f35e357806 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingTableExpr.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/BindingTableExpr.h @@ -26,7 +26,7 @@ namespace frontend { class BindingTableExpr : public AstNode { public: explicit BindingTableExpr(AstNodeType nodeType) : AstNode(nodeType) {} - ~BindingTableExpr() = default; + virtual ~BindingTableExpr() = default; }; // class BindingTableExpr } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/EndTransaction.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/EndTransaction.h index 785d0a74be..2dd8ab338b 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/EndTransaction.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/EndTransaction.h @@ -26,7 +26,7 @@ namespace frontend { class EndTransaction : public Transaction { public: explicit EndTransaction(AstNodeType type) : Transaction(type) {} - ~EndTransaction() = default; + virtual ~EndTransaction() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/LinearQueryStatement.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/LinearQueryStatement.h index 1e71516c0f..0e9e95a04b 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/LinearQueryStatement.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/LinearQueryStatement.h @@ -26,7 +26,7 @@ namespace frontend { class LinearQueryStatement : public AstNode { public: explicit LinearQueryStatement(AstNodeType nodeType) : AstNode(nodeType) {} - ~LinearQueryStatement() = default; + virtual ~LinearQueryStatement() = default; }; // class LinearQueryStatement } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/PrimitiveDataModifyStatement.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/PrimitiveDataModifyStatement.h index c318accba1..c267ab6631 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/PrimitiveDataModifyStatement.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/PrimitiveDataModifyStatement.h @@ -26,7 +26,7 @@ namespace frontend { class PrimitiveDataModifyStatement : public AstNode { public: explicit PrimitiveDataModifyStatement(AstNodeType nodeType) : AstNode(nodeType) {} - ~PrimitiveDataModifyStatement() = default; + virtual ~PrimitiveDataModifyStatement() = default; }; // class PrimitiveDataModifyStatement } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/ProcedureCall.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/ProcedureCall.h index ee7e8a077b..b5d9ae9fef 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/ProcedureCall.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/ProcedureCall.h @@ -26,7 +26,7 @@ namespace frontend { class ProcedureCall : public AstNode { public: explicit ProcedureCall(AstNodeType nodeType) : AstNode(nodeType) {} - ~ProcedureCall() = default; + virtual ~ProcedureCall() = default; }; // class ProcedureCall } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/Session.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/Session.h index 1bb9f6ff72..9ebd3c1a4e 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/Session.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/Session.h @@ -26,7 +26,7 @@ namespace frontend { class Session : public AstNode { public: explicit Session(AstNodeType type) : AstNode(type) {} - ~Session() = default; + virtual ~Session() = default; }; } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/SimpleQueryStatement.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/SimpleQueryStatement.h index 04abe52889..6d5cd05c07 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/SimpleQueryStatement.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/SimpleQueryStatement.h @@ -26,7 +26,7 @@ namespace frontend { class SimpleQueryStatement : public AstNode { public: explicit SimpleQueryStatement(AstNodeType nodeType) : AstNode(nodeType) {} - ~SimpleQueryStatement() = default; + virtual ~SimpleQueryStatement() = default; }; // class SimpleQueryStatement } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/Statement.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/Statement.h index 1108ace0e3..140af80992 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/Statement.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/Statement.h @@ -42,7 +42,7 @@ namespace frontend { class Statement : public AstNode { public: explicit Statement(AstNodeType nodeType) : AstNode(nodeType) {} - ~Statement() = default; + virtual ~Statement() = default; }; // class Statement } // namespace frontend diff --git a/deps/geax-front-end/include/geax-front-end/ast/stmt/Transaction.h b/deps/geax-front-end/include/geax-front-end/ast/stmt/Transaction.h index 06d1d562da..c4c840c1cf 100644 --- a/deps/geax-front-end/include/geax-front-end/ast/stmt/Transaction.h +++ b/deps/geax-front-end/include/geax-front-end/ast/stmt/Transaction.h @@ -26,7 +26,7 @@ namespace frontend { class Transaction : public AstNode { public: explicit Transaction(AstNodeType type) : AstNode(type) {} - ~Transaction() = default; + virtual ~Transaction() = default; }; } // namespace frontend