public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58591] New: GCC emits bad mangling for template function with a parameter pack
@ 2013-10-01 22:43 ccoutant at gcc dot gnu.org
  2013-10-01 22:49 ` [Bug c++/58591] " ccoutant at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2013-10-01 22:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58591

            Bug ID: 58591
           Summary: GCC emits bad mangling for template function with a
                    parameter pack
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ccoutant at gcc dot gnu.org

Created attachment 30944
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30944&action=edit
Reduced test case

This is reduced from <bits/stl_construct.h>.

Compiling the attached file with:

  $ g++ -S -std=c++11 mangle-test.cc

Produces the following mangled name for the function Construct:

  _Z9ConstructI1AIiiEEvPT_DpOT0_

This cannot be demangled, because the T0_ reference at the end refers to a
non-existent second template parameter. Removing the whole parameter pack from
the mangling reveals a bogus mangling in the template parameter section:

  $ c++filt _Z9ConstructI1AIiiEEvPT_
  void Construct<A<int, int> >(A<int, int>*)

The type A is not a template -- the two ints together form the parameter pack
that is the second template parameter.


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

* [Bug c++/58591] GCC emits bad mangling for template function with a parameter pack
  2013-10-01 22:43 [Bug c++/58591] New: GCC emits bad mangling for template function with a parameter pack ccoutant at gcc dot gnu.org
@ 2013-10-01 22:49 ` ccoutant at gcc dot gnu.org
  2013-10-04 20:37 ` ccoutant at gcc dot gnu.org
  2013-10-04 20:45 ` ccoutant at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2013-10-01 22:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58591

--- Comment #2 from Cary Coutant <ccoutant at gcc dot gnu.org> ---
I *think* the correct mangling should be this:

$ c++filt _Z9ConstructI1AiiEvPT_DpOT0_
void Construct<A, int, int>(A*, (int&&)...)


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

* [Bug c++/58591] GCC emits bad mangling for template function with a parameter pack
  2013-10-01 22:43 [Bug c++/58591] New: GCC emits bad mangling for template function with a parameter pack ccoutant at gcc dot gnu.org
  2013-10-01 22:49 ` [Bug c++/58591] " ccoutant at gcc dot gnu.org
@ 2013-10-04 20:37 ` ccoutant at gcc dot gnu.org
  2013-10-04 20:45 ` ccoutant at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2013-10-04 20:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58591

--- Comment #3 from Cary Coutant <ccoutant at gcc dot gnu.org> ---
I think the template argument descriptors should be "I1AJiiEE". This produces a
demangling that looks right:

$ c++filt _Z9ConstructI1AJiiEEvPT_DpOT0_
void Construct<A, int, int>(A*, int&&, int&&)

And running this test case through LLVM, that's the mangled name it produces.


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

* [Bug c++/58591] GCC emits bad mangling for template function with a parameter pack
  2013-10-01 22:43 [Bug c++/58591] New: GCC emits bad mangling for template function with a parameter pack ccoutant at gcc dot gnu.org
  2013-10-01 22:49 ` [Bug c++/58591] " ccoutant at gcc dot gnu.org
  2013-10-04 20:37 ` ccoutant at gcc dot gnu.org
@ 2013-10-04 20:45 ` ccoutant at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ccoutant at gcc dot gnu.org @ 2013-10-04 20:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58591

Cary Coutant <ccoutant at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Cary Coutant <ccoutant at gcc dot gnu.org> ---
Never mind, I see now that this was fixed with -fabi-version=6.

*** This bug has been marked as a duplicate of bug 51322 ***


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

end of thread, other threads:[~2013-10-04 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-01 22:43 [Bug c++/58591] New: GCC emits bad mangling for template function with a parameter pack ccoutant at gcc dot gnu.org
2013-10-01 22:49 ` [Bug c++/58591] " ccoutant at gcc dot gnu.org
2013-10-04 20:37 ` ccoutant at gcc dot gnu.org
2013-10-04 20:45 ` ccoutant at gcc dot gnu.org

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