Explicit destructor call unrecognized

Josh Stern jstern@citilink.com
Wed Aug 26 18:14:00 GMT 1998

[snottiness deleted]

I noted when I posted that ~*this had worked on other
compilers - specifically HP's old cfront-based compiler,
but I had a doubt about it's current legality.  I
apologize for not taking the time to check the standard,
but it seemed to be one of a series of bugs in the current 
egcs that I encountered today (I posted about a namespace
bug and I have another test case of the problem with static
consts, if anyone is interested).
>> However, in my example, the supposedly correct syntax is not
>> supported by the current egcs either - i.e.  ~Simple() also bombs.

>It'll work if you can fix your code (see below).

No, you didn't read the example carefully.
Shall I then follow your example and jump to the conclusion
that you don't know the language?

According to CD2 at least, ~Simple() should be accepted.
There is an example in 12.4.13

>Here I'll violate the golden rule that says I shouldn't answer...
Did you try this->~Simple()?

No, thanks for the tip. 

>Also, your code has other problems with it.  Hint, is Simple&
>operator=(const Simple& o) a member function (if so, it needs a
>declaration in the class).

Read it again.  In the simple test case I generated,
the declaration and definition were both inside the
class declaration. 

- Josh


More information about the Gcc-bugs mailing list