Updated mangling specs
Daveed Vandevoorde
daveed at edg.com
Sat Jan 29 00:02:09 UTC 2000
mendell at ca.ibm.com wrote:
>
> More questions:
>
> This was one of the questions I wanted to ask Daveed.
>
> The other one (maybe it's two) is:
>
> Does this rule only distinguish between instantiation that would be
> ambiguous if both template definition were visible at the instantiation
> point?
I believe that that is true.
> If so, do you know why the committee made this decision?
It grew out of discussions of what it meant for two template declarations
to refer to the same entity. A number of people felt it was important
not to outlaw examples like the ones we have been discussing. Not enough
people cared to defend the opposite situation. Back then I was naive and
unexperienced ;-) Oh, and I had no vote---don't shoot the messenger ;-)
> translation unit 1
> void f(char);
> void g() { f(1); }
>
> translation unit 2
> void f(int);
> void h() { f(1); }
>
> This is legal code, but I think is fairly obvious a blemish on the
> language.
Hmmm, I cannot make up my mind about that. Even when I transpose that
to a real module system, I see such situations as a possibility.
> External functions are usually declared in header files, so in
> general the programmer isn't going to know which f is being called and the
> inclusion of another header is going to change the behaviour of the
> program. Paragraph 5 of 14.5.5.1 seems to me to be there solely to make
> this situation worse. What am I missing?
I also find it to have little technical benefit.
It does guarantee us a job for life though <grin>.
Daveed
More information about the cxx-abi-dev
mailing list