From b2cb78166e0b31258e8403ff1adbb966bd8c763a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 27 Apr 2014 21:49:56 -0700 Subject: [PATCH] Give Rule a virtual destructor Not needed at the moment because rule pointers are are always wrapped in shared_ptrs. Still, don't want to forget this if I stopped using shared_ptrs at some point. --- src/compiler/rules/rule.cc | 2 ++ src/compiler/rules/rule.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/compiler/rules/rule.cc b/src/compiler/rules/rule.cc index 14daa6b5..9a6a7e02 100644 --- a/src/compiler/rules/rule.cc +++ b/src/compiler/rules/rule.cc @@ -21,5 +21,7 @@ namespace tree_sitter { stream << string("#"); return stream; } + + Rule::~Rule() {} } } diff --git a/src/compiler/rules/rule.h b/src/compiler/rules/rule.h index 5cc64203..132aa71a 100644 --- a/src/compiler/rules/rule.h +++ b/src/compiler/rules/rule.h @@ -19,6 +19,7 @@ namespace tree_sitter { virtual rule_ptr copy() const = 0; virtual std::string to_string() const = 0; virtual void accept(Visitor *visitor) const = 0; + virtual ~Rule(); }; std::ostream& operator<<(std::ostream& stream, const Rule &rule);