From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17634 invoked by alias); 6 Nov 2010 15:39:34 -0000 Received: (qmail 17619 invoked by uid 22791); 6 Nov 2010 15:39:33 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX,T_FRT_CONTACT X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 06 Nov 2010 15:39:29 +0000 From: "gcc-bugzilla at contacts dot eelis.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/46332] New: __cxa_demangle yields excess parentheses for function types X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc-bugzilla at contacts dot eelis.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 06 Nov 2010 15:39:00 -0000 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: 2010-11/txt/msg00743.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46332 Summary: __cxa_demangle yields excess parentheses for function types Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: gcc-bugzilla@contacts.eelis.net Consider: #include #include #include int main() { std::cout << abi::__cxa_demangle(typeid( void() ).name(), 0, 0, 0) << '\n'; } The output is "void ()()", but it should really just be "void ()". If "void ()()" had any meaning at all, it would denote the type of a function returning a function, but of course that's not valid C++. The same problem can also be seen by trying to compile and link the following program: template void f(); int main() { f(); } This produces: undefined reference to `void f()' Here, too, "void ()()" is wrong and should just be "void ()".