home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16004 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.5 KB

  1. Path: sparky!uunet!stanford.edu!ames!pacbell.com!hoptoad!brendan
  2. From: brendan@cygnus.com (Brendan Kehoe)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: g++ warning - destructor non virtual in inheritance relationship
  5. Message-ID: <38396@hoptoad.uucp>
  6. Date: 9 Nov 92 21:41:45 GMT
  7. References: <BxA3t2.39p@cs.columbia.edu>
  8. Sender: news@hoptoad.uucp
  9. Reply-To: brendan@cygnus.com
  10. Organization: Cygnus Support, Palo Alto CA; Phone +1 415 322 3811
  11. Lines: 25
  12. Nntp-Posting-Host: cygnus.com
  13. In-reply-to: ykim@cs.columbia.edu's message of Fri, 6 Nov 1992 05:12:38 GMT
  14.  
  15. In article <BxA3t2.39p@cs.columbia.edu> ykim@cs.columbia.edu (Yong Su Kim) writes:
  16.  
  17.    I have a class which inherits from two separate classes.
  18.  
  19.    eg class B: public c, public d
  20.  
  21.    and when I compile using g++, I get warning messages which say
  22.    something about d's destructor being non virtual in inheritance
  23.    relationship with B in the header file.
  24.  
  25.    It's just a warning, but I don't understand what is causing the
  26.    problem.  If someone could point out what I am doing wrong, it would
  27.    be great.  It's annoying having to see the same warnings again and
  28.    again every time the .h file is included in a .cc file.
  29.  
  30.  
  31. The warning derives from the notes in ARM section 12.4, advising that
  32. as a rule of thumb, you should declare a virtual destructor in every
  33. base class that has a virtual function.
  34.  
  35. Brendan
  36. --
  37. Brendan Kehoe                                               brendan@cygnus.com
  38. Cygnus Support, Palo Alto, CA                                  +1 415 322 3811
  39.  
  40.