On Wed, Aug 3, 2016 at 3:10 PM, Martin Sebor <mse...@gmail.com> wrote:
>>>> Do you have ideas about how to improve the naming?  Perhaps change
>>>> TYPE_ANONYMOUS_P to TYPE_NO_LINKAGE_NAME?
>>>
>>> I haven't thought about changing names but TYPE_NO_LINKAGE_NAME
>>> seems better than TYPE_ANONYMOUS_P.
>>
>> Or perhaps TYPE_UNNAMED_P.
>
> TYPE_UNNAMED_P would work but it wouldn't be a replacement for
> TYPE_ANONYMOUS_P.
>
> It sounds like TYPE_ANONYMOUS_P is the right name and the problem
> is that the value it returns isn't accurate until the full context
> to which it applies has been seen.

I think you're thinking of ANON_AGGR_TYPE_P, which identifies
anonymous structs/unions; TYPE_ANONYMOUS_P identifies unnamed classes.

> I wonder if the right solution to this class of problems (which
> are probably unavoidable in the front end as the tree is being
> constructed), is to design an API that prevents using these
> "unreliable" queries until they can return a reliable result.

It would be possible to change ANON_AGGR_TYPE_P to require
COMPLETE_TYPE_P, but a lot of uses will need to be adjusted to avoid
crashing.

Jason

Reply via email to