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: unassig...@gcc.gnu.org
        ReportedBy: gcc-bugzi...@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 ()".

Reply via email to