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]

Re: egcs 1.1 regression failure


> I think it should be fixed for egcs 1.1.

I don't think so. You forgot to count copy constructors

mira% ./a
A
A copy
~A
Caught system exception.
~A

Martin

a.cc

#include <stdio.h>
#include <stdlib.h>

static int x = 0;

class A {
public:
  A() {
    printf ("A\n");
    x++;
  }
  A(const A&){
    printf ("A copy\n");
    x++;
  }
  ~A() {
    printf ("~A\n");
    x--;
  }
};

main (int argc, char **argv)
{
  try {
    throw A();
  }
  catch (...) {
    printf ("Caught system exception.\n");
  }
  if (x != 0)
    abort ();
  return 0;
}



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