Notes from the meeting
Martin von Loewis
loewis at informatik.hu-berlin.de
Thu Jul 6 22:37:25 UTC 2000
> Upon further thought, though, I don't think this is needed. The
> two functions have different definitions, with different
> hierarchical names. The result adjustment is determined by which
> function is called and where it is called from, and there
> shouldn't be an opportunity to confuse them.
>
> Am I missing something?
I think so, yes. What do you mean by "hierarchical names"? Consider
struct A{};struct B:primary,A{};
struct Base{
virtual A* func(int); // _ZN4Base4funcEi
};
struct Derived:Base{
B* func(int);
};
Now, _ZN7Derived4funcEi refers to - what? In the vtable of Derived,
you have two slots - what symbols do you put in there?
The obvious solution would be to have
_ZN7Derived4funcEP1Ai // A* Derived::func(int)
_ZN7Derived4funcEP1Bi // B* Derived::func(int)
However, that won't work, because e.g. the first one is confused with
Ret? Derived::func(A*, int)
and the same confusion arises for the second one. Was there any
concrete proposal in the meeting?
If not, here is a strawman proposal: Markup a return type, so you can
tell whether a type in the parameter list is the first parameter or
the return type:
<return type> ::= _ <type>
With that, we'd get
_ZN4Base4funcEi // Ret? Base::func(int)
_ZN7Derived4funcE_P1Ai // A* Derived::func(int)
_ZN7Derived4funcE_P1Bi // B* Derived::func(int)
Regards,
Martin
More information about the cxx-abi-dev
mailing list