Skip to content

Commit

Permalink
Add default virtual destructor for Parser class.
Browse files Browse the repository at this point in the history
This fixed clang `[-Wdelete-non-abstract-non-virtual-dtor]` warning:
    delete called on non-final 'ManifestParser' that has virtual
    functions but non-virtual destructor.
for `subparser_.reset(new ManifestParser(state_, file_reader_, options_));`.
  • Loading branch information
zufuliu committed Dec 9, 2024
1 parent d344479 commit 32e9958
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct State;
struct Parser {
Parser(State* state, FileReader* file_reader)
: state_(state), file_reader_(file_reader) {}
virtual ~Parser() {}

/// Load and parse a file.
bool Load(const std::string& filename, std::string* err, Lexer* parent = NULL);
Expand Down

0 comments on commit 32e9958

Please sign in to comment.