This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++ exception spec bug


Using -fomit-frame-pointer in combinations with (restrictive) exceptions
specs doesn't work correctly in the latest gcc cvs tree.

This piece of code aborts incorrectly (it should catch):

class dummy {
  int x;
public:
  dummy(void) throw() : x(0) {}
  ~dummy(void) {}
};

void thrower(void) throw(int) {
  dummy dobj;
  throw 10;
}

int main(void) throw() {
  try {
    thrower();
  } catch(int) {
  }
}

Replacing 'void thrower(void) throw(int)' with 'void thrower(void)' fixes
this. Strangely, turning on the -fno-enforce-eh-specs also fixes the abort,
not sure whether the object gets destructed though, using
-fno-enforce-eh-specs doesn't work for the larger sources I've tried.

Thomas
-- 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]