Given the following translation unit: inline int (*foo())() { struct localstruct { static int f() { return 3; } }; return localstruct::f; }
GCC mangles foo::localstruct::f as '_ZZ3foovEN11localstruct1fEv'. According to the C++ ABI (see especially the third example in section 5.1.6) it should be _ZNZ3foovE11localstruct1fEv That is, it should be <function name> <bare-function-type> at the top level, not a <local-name>. This is of course an ABI-breaking change. -- Summary: name mangling for nested functions is wrong Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: ABI Severity: major Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: geoffk at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29773