This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++ 2.95.2: goto+dtor bug
- To: bug-gcc at gnu dot org
- Subject: c++ 2.95.2: goto+dtor bug
- From: "Alexander V. Lukyanov" <lav at long dot yar dot ru>
- Date: Sat, 12 Feb 2000 19:28:35 +0300
Here is a program where destructor is not run at all. No warning is produced
either. Test system: gcc-2.95.2, linux, glibc-2.1.2.
#include <stdio.h>
class a
{
public:
a() { printf("ctor\n"); }
~a() { printf("dtor\n"); }
};
int main(int argc,char **argv)
{
if(argc>1)
{
leave:
return 0;
}
a var;
goto leave;
}