Skip to content

Commit

Permalink
[C++] Fix missing virtual destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
jcking committed Feb 1, 2022
1 parent c41663a commit 2a11c76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions runtime/Cpp/runtime/src/atn/LexerActionExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace atn {
/// <param name="lexerActions"> The lexer actions to execute. </param>
explicit LexerActionExecutor(std::vector<Ref<LexerAction>> lexerActions);

virtual ~LexerActionExecutor() = default;

/// <summary>
/// Creates a <seealso cref="LexerActionExecutor"/> which executes the actions for
/// the input {@code lexerActionExecutor} followed by a specified
Expand Down
3 changes: 0 additions & 3 deletions runtime/Cpp/runtime/src/atn/PredictionContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ const Ref<PredictionContext> PredictionContext::EMPTY = std::make_shared<EmptyPr
PredictionContext::PredictionContext(size_t cachedHashCode) : id(globalNodeCount.fetch_add(1, std::memory_order_relaxed)), cachedHashCode(cachedHashCode) {
}

PredictionContext::~PredictionContext() {
}

Ref<PredictionContext> PredictionContext::fromRuleContext(const ATN &atn, RuleContext *outerContext) {
if (outerContext == nullptr) {
return PredictionContext::EMPTY;
Expand Down
5 changes: 3 additions & 2 deletions runtime/Cpp/runtime/src/atn/PredictionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ namespace atn {
const size_t cachedHashCode;

protected:
PredictionContext(size_t cachedHashCode);
~PredictionContext();
explicit PredictionContext(size_t cachedHashCode);

virtual ~PredictionContext() = default;

public:
/// Convert a RuleContext tree to a PredictionContext graph.
Expand Down

0 comments on commit 2a11c76

Please sign in to comment.