Parcourir la source

[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.
JINMEI Tatuya il y a 12 ans
Parent
commit
3f1afa7c18
2 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 2 0
      src/lib/dns/master_lexer.cc
  2. 6 0
      src/lib/dns/master_lexer_state.h

+ 2 - 0
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);
     }

+ 6 - 0
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