exception handling bug?

Marc Lehmann pcg@goof.com
Sat Nov 22 12:17:00 GMT 1997


this program:

struct E {
   int x;
   E(int i) { x = i; };
};

int main()
{
   try {
      E *p = new E(5);
      throw p;
   }
   
   catch (E *&e) {
      printf ("address of e is %d\n", (long)e);
   }
}

prints "address of e is 5" instead of the *address* of e. I'm
no exception expert, but IMHO this should print the contents of "p"
instead.

      -----==-
      ----==-- _
      ---==---(_)__  __ ____  __       Marc Lehmann
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com
      -=====/_/_//_/\_,_/ /_/\_\
    The choice of a GNU generation



More information about the Gcc mailing list