https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67268

Henning Meyer <hmeyer.eu at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hmeyer.eu at gmail dot com

--- Comment #2 from Henning Meyer <hmeyer.eu at gmail dot com> ---
This bug still exists in GCC 15.

I noticed when creating a std::thread

_ZNSt6threadC1IRFvvEJEvEEOT_DpOT0_ demangles to "std::thread::thread<void
(&)(), , void>(void (&)())"

The simplest example is


template<typename... Args, typename = void>
void funk(Args&&... ) {}

which when called as funk();

mangles to

_Z4funkIJEvEvDpOT_

which demangles to "void funk<, void>()"

For a templated function or method, a template parameter pack may be followed
by further template arguments, including more packs, possibly empty.

When I build the standalone demangler in libiberty, I get this parse tree
./a.out -v _Z4funkIJEvEvDpOT_
typed name
  template
    name 'funk'
    template argument list
      template argument list
      template argument list
        builtin type void
  function type
    builtin type void
    argument list
      pack expansion
        rvalue reference
          template parameter 0
void funk<, void>()

which is not what I would expect. I would expect 

typed name
  template
    name 'funk'
    template argument list
      template argument list
      builtin type void

for a template argument list consisting of an empty pack and the type void.

Which indicates to me that the bug is in the parsing logic and not in the
formatting logic.

Reply via email to