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'.
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 >
You're right: it works with -fabi-version is 0. Closing as invalid.
Reopening...
to close as dup of PR16240. *** This bug has been marked as a duplicate of 16240 ***