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