Is this a 3.4.2 bug (segfault compiling arts) ?

Jason Mancini jayrusman@hotmail.com
Thu Oct 14 11:04:00 GMT 2004


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;



--




More information about the Gcc mailing list