[cxx-abi-dev] restrict & overloading

Daveed Vandevoorde daveed at edg.com
Wed Feb 18 22:42:22 UTC 2004


On Feb 18, 2004, at 5:25 PM, Mark Mitchell wrote:

>
>> Adding restrict changes the type.  It is an
>> interface element (e.g., telling the client code:
>> Passing aliased arguments may burn you).  In that
>> way, restrict is different from e.g. "const."
>
> Yes, I understand: you are arguing that by mangling restrict you could 
> prevent a class of user errors involving linking together things that 
> should not be linked together.
>
> I don't think the ABI design philosophy involved trying to prevent 
> user errors -- it was just on doing what the standard required in an 
> efficient manner.

True but there is more to it than invalid programs.

// File 1:
void f(int **) {}

// File 2:
void f(int *restrict*) {}

If this ends up being allowed by WG21 (while overload
resolution will likely not distinguish these), the ABI
note will keep us from being conformant.

I find it strange that an ABI constraint is formulated
in terms of "overload resolution" which is not really
an ABI element.  What does it buy us?

I suspect that the words "for overloading purposes" were
not really intended.  I.e., think it should say: if an
implementation treats restrict as part of the type, it
mangles it; if not, it doesn't.

	Daveed




More information about the cxx-abi-dev mailing list