On Sun, Apr 1, 2018 at 5:33 AM, Jason Vas Dias <jason.vas.d...@gmail.com> wrote: > Aha! But how to determine the mangled name beforehand ? > > Even if I compile the object without the alias, then inspect > the object with objdump, there is no mangled symbol > _ZL3foov defined in the object file . > > So I must run some name mangler / generator as a > pre-processing step to get the correct mangled name > string ?
I guess so. Or you could define foo with C linkage: extern "C" { static inline __attribute__((always_inline)) void foo(void){} }; static inline __attribute__((always_inline,alias("foo"))) void bar(void); static void f(void) { foo(); } // must have a usage to generate any code > I think it is unacceptable to be forced to used > mangled symbol names for objects which are > not symbols (pure inline functions) . Pure inline functions may be overloaded, how will you decide which one to alias given only unmangled name? -- Thanks. -- Max