Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Fix missing virtual destructors #3523

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,10 +65,11 @@ namespace atn {
const size_t cachedHashCode;

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

public:
virtual ~PredictionContext() = default;

/// Convert a RuleContext tree to a PredictionContext graph.
/// Return EMPTY if outerContext is empty.
static Ref<PredictionContext> fromRuleContext(const ATN &atn, RuleContext *outerContext);
Expand Down