public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/46332] New: __cxa_demangle yields excess parentheses for function types
@ 2010-11-06 15:39 gcc-bugzilla at contacts dot eelis.net
  2010-11-07 11:08 ` [Bug other/46332] " paolo.carlini at oracle dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: gcc-bugzilla at contacts dot eelis.net @ 2010-11-06 15:39 UTC (permalink / raw)
  To: gcc-bugs

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 ()".


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-11-16 14:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-06 15:39 [Bug libstdc++/46332] New: __cxa_demangle yields excess parentheses for function types gcc-bugzilla at contacts dot eelis.net
2010-11-07 11:08 ` [Bug other/46332] " paolo.carlini at oracle dot com
2010-11-09 17:02 ` paolo.carlini at oracle dot com
2010-11-09 17:26 ` gcc-bugzilla at contacts dot eelis.net
2010-11-09 18:07 ` paolo.carlini at oracle dot com
2010-11-09 18:10 ` paolo.carlini at oracle dot com
2010-11-09 19:53 ` ian at airs dot com
2010-11-09 19:55 ` ian at airs dot com
2010-11-09 19:55 ` paolo.carlini at oracle dot com
2010-11-09 19:58 ` hjl.tools at gmail dot com
2010-11-09 23:01 ` bkoz at gcc dot gnu.org
2010-11-10  5:17 ` ian at airs dot com
2010-11-10  8:25 ` paolo.carlini at oracle dot com
2010-11-10 15:24 ` bkoz at gcc dot gnu.org
2010-11-10 16:46 ` redi at gcc dot gnu.org
2010-11-13  1:32 ` ian at gcc dot gnu.org
2010-11-13  1:37 ` ian at airs dot com
2010-11-16 14:52 ` ian at airs dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).