I also suggested that the compiler does not generate code relative to "a" since it does not reference, but still, this is not the correct behavior, because the destructor does something that needs to be executed.
So, I tried in VS2008 / vc9 (+ SP1), Debug and Release and ~ A is called after the exception is thrown, exiting f () - this is the correct behavior, if I am right.
Now I just tried with VS2005 / vc8 (+ SP1), and this is the same behavior.
I used breakpoints to be sure. I just checked with the console and I also have the message "~ A". Maybe you did it wrong elsewhere?
Klaim Oct 21 '08 at 15:02 2008-10-21 15:02
source share