> On Apr 4, 2025, at 12:40, Jakub Jelinek <ja...@redhat.com> wrote:
> 
> On Fri, Apr 04, 2025 at 04:25:11PM +0000, Qing Zhao wrote:
>>> It is not just the parser, it is also the human reader who should be
>>> able to clearly distinguish this (which is why I still prefer
>>> designators syntax because this makes it perfectly clear).
>> 
>> Yes, the forward declaration approach is just a compromised approach in 
>> order to work with 
>> C++ in the future.
> 
> I thought the forward decl approach is there just for C.

If it’s only for C, I think that the new keyword __self approach should be the 
best one.

However, since Apple people insisted that the same attribute with the same 
syntax 
will be used in C++ as well (I think that this the root reason for  this whole 
discussion).

Then a syntax can be accepted by both C and C++ is needed here.

This forward decl approach is a compromised approach for this purpose. Looks 
reasonable
for both C and C++. 

(Do I miss anything here?)


> C++ doesn't really need it, it has tons of other parts of the class parsed
> only when the class is complete (e.g. in class method definition bodies,
> NSDMIs, ...).  So it wouldn't be really strange to let the attribute
> argument be parsed for C++ only when the class is complete too.
> And IMHO it should use the this->member syntax there.

If different syntaxes of  the counted_by attribute for C and C++ is accepted 
(which I prefer -:).

Then for C, I prefer __self approach.

Qing

> 
> Jakub
> 

Reply via email to