[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#260747: g++-3.4 miscompiles code



I found the cause of this error: for some reason the global destructor
for idl_filename is being called twice.  I've attached a small test
case which trips the same bug; when compiled with g++-3.3, it produces
no output, but when compiled with g++-3.4, it outputs an error
message.
-- 
Daniel Schepler              "Please don't disillusion me.  I
schepler@math.berkeley.edu    haven't had breakfast yet."
                                 -- Orson Scott Card
#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;

Reply to: