From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20622 invoked by alias); 18 Sep 2003 18:55:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20613 invoked by uid 48); 18 Sep 2003 18:55:12 -0000 Date: Thu, 18 Sep 2003 19:27:00 -0000 From: "John dot Bossom at cognos dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20030918185509.12333.John.Bossom@cognos.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12333] New: Explicit call to MyClass::~MyClass() yields "sorry, unimplemented" X-Bugzilla-Reason: CC X-SW-Source: 2003-09/txt/msg01498.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333 Summary: Explicit call to MyClass::~MyClass() yields "sorry, unimplemented" Product: gcc Version: 3.3.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: John dot Bossom at cognos dot com CC: gcc-bugs at gcc dot gnu dot org // // ============================================================== // Description // ============================================================== // gcc does not implicitly map "MyClass::~MyClass()" used within a // method of "MyClass" to the current object's MyClass destructor. // // This technique is valid on Vendor's C++ Compilers // MSVC++ 6.0 // SunOS C++ 5.3 // AIX xlC_r 5.0 // HP-UX aCC A.03.33 // // The compile line and resulting error are included at the // end of this file. // // ============================================================== // Workaround: // ============================================================== // Explicitly cast "this" to MyClass // // // ============================================================== // gcc Version: 3.3.1 (g++ -v ) // ============================================================== // g++ -v // Reading specs from /local/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs // Configured with: /local/gcc_build/src/gcc-3.3.1/configure -prefix=/local --enable-languages=c,c++ : (reconfigured) /local/gcc_build/src/gcc-3.3.1/configure -prefix=/local/gcc --enable-languages=c,c++ // Thread model: posix // gcc version 3.3.1 // // ============================================================== // system type: Linus Enterprise Server Edition 2.1 WS (uname -a) // ============================================================== // // Linux lweslx1.cognos.com 2.4.9-e.12 #1 Tue Feb 11 03:12:29 EST 2003 i686 unknown class MyClass { virtual void destroy() { #ifdef BUG // This should implicitly map to the exact MyClass destructor MyClass::~MyClass(); #else // Workaround static_cast< MyClass >( *this ).~MyClass(); #endif } public: MyClass(){} virtual ~MyClass(){} }; // g++ -DBUG -c bug.cc // bug.cc: In member function `virtual void MyClass::destroy()': // bug.cc:45: error: 'class MyClass' has no member named '`type_decl' not // bug.cc:45: sorry, unimplemented: supported by dump_expr // bug.cc:45: sorry, unimplemented: ~'