home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:13083 gnu.g++.help:1168
- Path: sparky!uunet!haven.umd.edu!cs.wvu.wvnet.edu!schiebel
- From: schiebel@cs.wvu.wvnet.edu (Darrell Schiebel)
- Newsgroups: comp.lang.c++,gnu.gcc,gnu.g++.help
- Subject: Explicit Calls to Destructors (SunCC=ok, gcc=not)
- Keywords: destructors
- Message-ID: <2234@h.cs.wvu.wvnet.edu>
- Date: 31 Aug 92 12:46:44 GMT
- Followup-To: comp.lang.c++
- Organization: WVU Statistics and Computer Science
- Lines: 39
-
-
- In the Sun (SC1.0 w/ cfront 2.1 (I think)), an explicit call
- to a class' destructor from within a one of the class' member
- functions works:
-
- void Tess::cleanup(Bool abort) {
- Tess::~Tess();
- }
-
- However, in gcc-2.2.2 this does not work, and gives the error:
-
- test.cc: In method `void Tess::cleanup (enum Bool)':
- test.cc:28: destructor specification error
-
- Other nonworking variations:
-
- this->~Tess(); AND
- (*this).~Tess(); WITH THE ERROR MESSAGE:
-
- test.cc: In method `void Tess::cleanup (enum Bool)':
- test.cc:30: address of `this' not available
-
- and finally:
-
- ~Tess(); WITH:
-
- test.cc: In method `void Tess::cleanup (enum Bool)':
- test.cc:30: invalid functional cast
-
- Is there some way to get around this in gcc? Its exactly what
- I want to do; I don't want to force users of my class to call
- parent ``cleanup'' functions, in children. Explicit calls to
- destructors is permitted, ARM p.278, sec 12.4.
-
-
- thanks,
- Darrell Schiebel
- (schiebel@a.cs.wvu.wvnet.edu)
-
-