Bug 39208 - Incorrect mangled name for function as template argument
Summary: Incorrect mangled name for function as template argument
Status: RESOLVED DUPLICATE of bug 16240
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-16 22:07 UTC by dgregor
Modified: 2009-02-16 22:41 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dgregor 2009-02-16 22:07:30 UTC
Given the following code:

  template<int (&p)(int, int)> struct X { };
  int f(int, int) { }
  void g(X<f>) { }

GCC produces the mangled name:

  _Z1g1XILZ1fiiEE

for the function 'g'. However, the correct mangled name is:

  _Z1g1XIL_Z1fiiEE

GCC is missing the '_' prior to the 'Z' in the mangled name of the template argument 'f'.
Comment 1 pinskia@gmail.com 2009-02-16 22:28:13 UTC
Subject: Re:   New: Incorrect mangled name for function as template argument

Yes this known I forgot the bug number but try with -fabi-version=0.

Sent from my iPhone

On Feb 16, 2009, at 2:07 PM, "dgregor at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> Given the following code:
>
>  template<int (&p)(int, int)> struct X { };
>  int f(int, int) { }
>  void g(X<f>) { }
>
> GCC produces the mangled name:
>
>  _Z1g1XILZ1fiiEE
>
> for the function 'g'. However, the correct mangled name is:
>
>  _Z1g1XIL_Z1fiiEE
>
> GCC is missing the '_' prior to the 'Z' in the mangled name of the  
> template
> argument 'f'.
>
>
> -- 
>           Summary: Incorrect mangled name for function as template  
> argument
>           Product: gcc
>           Version: 4.3.3
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: c++
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: dgregor at gcc dot gnu dot org
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39208
>
Comment 2 dgregor 2009-02-16 22:37:31 UTC
You're right: it works with -fabi-version is 0. Closing as invalid.
Comment 3 Jakub Jelinek 2009-02-16 22:40:45 UTC
Reopening...
Comment 4 Jakub Jelinek 2009-02-16 22:41:05 UTC
to close as dup of PR16240.

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