www.digitalmars.com         C & C++   DMDScript  

c++ - Compiler in endless loop


when compiling folowing example with DMC V8.44.6n the compiler reports 
the unknown pointer in the destructor of template PADEL and then hangs. 
It can only be terminated by Control-C

  template<class T>
  class PADEL {
     PADEL(T* p) : ptr(p) {}
     ~PADEL() {delete[] p;} // p is mistake, wanted ptr
     T *ptr;

  int main()
     int *ip = new int[10];
     PADEL<int> ip_care(ip);
     return 0;

I know that I don't have the latest version. So if it's already solved I 
will download the latest DMC.

- Heinz
Dec 14 2005