[cxx-abi-dev] restrict & overloading

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


On Feb 18, 2004, at 3:56 PM, Mark Mitchell wrote:

> Daveed Vandevoorde wrote:
>
>> One of the J16 reflectors is currently discussing
>> "restrict."  I went looking to the IA-64 ABI spec
>> and was surprised to see it saying the following:
>>
>>   The restrict qualifier is part of the C99 standard,
>>   but is strictly an extension to C++ at this time.
>>   There is no standard specification of whether the
>>   restrict attribute is part of the type for overloading
>>   purposes. An implementation should include its encoding
>>   in the mangled name if and only if it also treats it as
>>   a distinguishing attribute for overloading purposes.
>>   This ABI does not specify that choice.
>>
>> I would think that even though restrict does not
>> make a type overload-distinguishable, it should
>> be encoded in the mangled name (at least, if it
>> has nontrivial semantics).
>
> The C++ ABI already differs from what is perhaps the EDG
>  philosophy in this regard.

Actually, this is not currently the EDG model either
(which surprised me too).

> For example, the ABI explicitly does not encode implicit 
> instantiations and explicit specializations differently, even though 
> that would provide a way of checking a rule in the standard -- and 
> even though the EDG front end could do that in its Cfront-based ABI.

But that's different in that the implicit and
explicit specializations have the same type.

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."

	Daveed




More information about the cxx-abi-dev mailing list