The following code used to trigger a warning with gcc 4.2 and 4.3 but passes silently with 4.4 and 4.5:
===================================== #include <memory> struct S; int main() { std::auto_ptr<S> p( (S*) 1234 ); } ===================================== This code triggers a segfault but when the pointer is actually from a real object, then its destructor simply is not called and resources are leaked. -- Summary: auto_ptr used with incomplete type no longer triggers warning Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rlerallut at free dot fr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43820