This is the mail archive of the gcc-bugs@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]

Bug! Re-throw in catch() block causes core dump (egcs-1.0.1)


[Note: I don't know if this a already a know bug, I looked at the egcs-bugs
archive and didn't see anything obvious.]

The following program causes a core dump (the rethrow line):


--- cut here ---
#include <iostream.h>

void foo() throw (const char*)
{
  cout << "in function foo() - throw exception" << endl;

  throw "foo except";
}

int main()
{

  try {
   foo();
  }
  catch (const char*) {
    cout << "caught exception" << endl;
    throw; // rethrow
  }
  catch (...) {
    cout << "Unexpected: caught exception" << endl;
  }
}
--- cut here ---

System: Linux i686, 2.0.32, glibc2-2.0.5, egcs-1.0.1

Can someone else confirm that this is a bug?  This is legal
C++, correct?

Cheers,
Glenn                                  
--------------------
Glenn R. Kronschnabl
Applied Research Laboratories        | grk@arlut.utexas.edu (PGP/MIME ok)
The University of Texas at Austin    | http://www.arlut.utexas.edu/~grk
PO Box 8029, Austin, TX 78713-8029   | (Ph) 512.835.3642 (FAX) 512.835.3808
10,000 Burnet Road, Austin, TX 78758 | ... but an Aggie at heart!


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