This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a 3.4.2 bug (segfault compiling arts) ?
- From: "Jason Mancini" <jayrusman at hotmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 14 Oct 2004 00:09:03 -0700
- Subject: Re: Is this a 3.4.2 bug (segfault compiling arts) ?
- Bcc:
Well according to
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=260747
the distilled Oct 9th testcase is below. Removing extern seems to make the
crash go away.
--
#include <iostream>
class Foo {
public:
Foo() { destroyed_ = false; }
~Foo() { if (destroyed_) std::cerr << "Destructor called twice!\n";
destroyed_ = true; }
void nop() { }
private:
bool destroyed_;
};
Foo bar;
int main() {
bar.nop();
return 0;
}
extern Foo bar;
--