warning: possible problem detected in invocation of delete operator: warning: ‘x’ has incomplete type warning: forward declaration of ‘struct X’ note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
$g++ test.cpp main.cpp In destructor ‘std::auto_ptr<_Tp>::~auto_ptr() [with _Tp = A::Impl]’: test.h:4: instantiated from here warning: possible problem detected in invocation of delete operator: warning: invalid use of undefined type ‘struct A::Impl’ test.h:5: warning: forward declaration of ‘struct A::Impl’ note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.