Suppose I have something along the lines of
struct Foo {
void goo() {printf("Test");}
}
external void _ZN3Foo3gooEv(Foo *f);
int main() {
Foo f;
_ZN3Foo3gooEv(&f);
}
Is it possible to call Foo::goo() through the name mangled version of the function here?
Edit:
As a clarification, this is just an experiment to see if it's possible to explicitly call a name mangled function. There is no further goal here.
I was thought that all member functions basically take the this pointer as their first argument.
I get that this won't link, but I don't get why. I thought that name mangling happens at compile time, and when the linker runs it resolves the calls to the name mangled function. (That's why I figured if we leave _ZN3Foo3gooEv as extern, it would go to the symbol table to look it up).
Am I misunderstanding something here?