From: JINMEI Tatuya Date: Wed, 14 Nov 2012 03:53:18 +0000 (-0800) Subject: [master] define virtual dtor for master lexer state classes. X-Git-Tag: trac2487_base~1^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f1afa7c181c802ba2dab143cc9b5f72e8e1de69;p=thirdparty%2Fkea.git [master] define virtual dtor for master lexer state classes. just for silencing some compilers. in our usage this doesn't matter in practice. committing at my discretion. --- diff --git a/src/lib/dns/master_lexer.cc b/src/lib/dns/master_lexer.cc index 992a051048..0978a8fbcb 100644 --- a/src/lib/dns/master_lexer.cc +++ b/src/lib/dns/master_lexer.cc @@ -170,6 +170,7 @@ namespace { class CRLF : public State { public: CRLF() {} + virtual ~CRLF() {} // see the base class for the destructor virtual const State* handle(MasterLexer& lexer) const { // We've just seen '\r'. If this is part of a sequence of '\r\n', // we combine them as a single END-OF-LINE. Otherwise we treat the @@ -195,6 +196,7 @@ public: class String : public State { public: String() {} + virtual ~String() {} // see the base class for the destructor virtual const State* handle(MasterLexer& /*lexer*/) const { return (NULL); } diff --git a/src/lib/dns/master_lexer_state.h b/src/lib/dns/master_lexer_state.h index 86957c5e3f..1130f3334f 100644 --- a/src/lib/dns/master_lexer_state.h +++ b/src/lib/dns/master_lexer_state.h @@ -55,6 +55,12 @@ namespace master_lexer_internal { /// this library are expected to use this class. class State { public: + /// \brief Virtual destructor. + /// + /// In our usage this actually doesn't matter, but some compilers complain + /// about it and we need to silence them. + virtual ~State() {} + /// \brief Begin state transitions to get the next token. /// /// This is the first method that \c MasterLexer needs to call for a