From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7013 invoked by alias); 27 Dec 2009 07:45:08 -0000 Received: (qmail 6813 invoked by uid 48); 27 Dec 2009 07:44:50 -0000 Date: Sun, 27 Dec 2009 07:45:00 -0000 Subject: [Bug c++/42514] New: Invalid Destructor Name of A Template Class Is Accepted X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "shreks2099 at yahoo dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg02482.txt.bz2 Obviously the following code of the definition of class destructor is wrong, but it passed g++ 4.4.2 in Fedora 12. However g++ 4.1.2 and g++ 3.4.6 in Fedora 12 reported the error. The testing code is list below: #include template class Base { public: Base(); ~Base(); }; template Base::Base() { std::cout << "Base()" << std::endl; } template Base::~BaseTypo() { std::cout << "~BaseTypo()" << std::endl; } int main() { Base* pObj = new Base (); delete pObj; return 0; } -- Summary: Invalid Destructor Name of A Template Class Is Accepted Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: shreks2099 at yahoo dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42514