17976 – [3.4/4.0 Regression] Calls the dtor twice (original) (raw)
Description Drea Pinski 2004-10-13 18:38:45 UTC
extern "C" void abort(); struct A { static int i; A(){} ~A(){i++;if(i>1)abort();} };
int A::i = 0;
A a; extern A a;
int main() { return 0; }
Comment 1 Drea Pinski 2004-10-13 18:41:54 UTC
Oh, it is a regression.
Comment 2 Drea Pinski 2004-10-13 18:42:43 UTC
*** Bug 17977 has been marked as a duplicate of this bug. ***
Comment 3 Drea Pinski 2004-10-13 18:46:17 UTC
I did not know how hard it would to generate a self contained testcase which is why I had asked you file one (I just decided to file one after I got a tescase).
Comment 4 Drea Pinski 2004-10-14 12:28:12 UTC
*** Bug 17996 has been marked as a duplicate of this bug. ***
Comment 8 Mark Mitchell 2004-10-15 04:25:12 UTC
Fixed in GCC 3.4.3.