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]

exception handling bug?



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


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