]> sourceware.org Git - systemtap.git/commitdiff
parse: Fix a -Werror=delete-non-virtual-dtor
authorJosh Stone <jistone@redhat.com>
Tue, 7 Aug 2012 19:24:18 +0000 (12:24 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 7 Aug 2012 19:24:18 +0000 (12:24 -0700)
  CXX    stap-parse.o
../parse.cxx: In destructor ‘parser::pp1_activation::~pp1_activation()’:
../parse.cxx:421:16: error: deleting object of polymorphic class type
‘parser::pp_macrodecl’ which has non-virtual destructor might cause
undefined behaviour [-Werror=delete-non-virtual-dtor]
cc1plus: all warnings being treated as errors

We need virtual ~macrodecl to destroy the inherited pp_macrodecl.

parse.h

diff --git a/parse.h b/parse.h
index 4752503195f8926c5492521996b9696d865e5995..7f8849a6b9e0eb13469f933675ccdcfb1d79bad4 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -82,7 +82,7 @@ struct macrodecl {
   virtual bool is_closure() { return false; }
 
   macrodecl () : tok(0), context(ctx_local) { }
-  ~macrodecl ();
+  virtual ~macrodecl ();
 };
 
 
This page took 0.027105 seconds and 5 git commands to generate.