[Bug libstdc++/46332] New: __cxa_demangle yields excess parentheses for function types
gcc-bugzilla at contacts dot eelis.net
gcc-bugzilla@gcc.gnu.org
Sat Nov 6 15:39:00 GMT 2010
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 <iostream>
#include <typeinfo>
#include <cxxabi.h>
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 <typename> void f();
int main() { f<void()>(); }
This produces:
undefined reference to `void f<void ()()>()'
Here, too, "void ()()" is wrong and should just be "void ()".
More information about the Gcc-bugs
mailing list