On 10 May 2012 17:02, Paolo Carlini <pcarl...@gmail.com> wrote: > Hi, > >> On 05/10/2012 10:52 AM, Paolo Carlini wrote: >>> Was thinking: would it make sense to have a predicate for 'any' pointer >>> type? >> >> Something like TYPE_PTR_OR_PTRMEM_P would be fine. > > Good. > >> Hmm, I see that TYPE_PTRMEM_P only means pointer to data member, that's >> unfortunate; the name doesn't make that clear. > > So, let's have a plan about the names of such predicates and I'll implement > it as soon as possible.
Yes, please. It feels as if the names are based more on the underlying implementation of the macro than on anything else. Also, short names are nice, but using MEM instead of MEMBER is a bit too short. The same for OB for object and others. PTR_OR_PTRMEM sounds to me like "pointer or pointer to member", which sounds redundant since a pointer to member is a pointer already. And there is also TYPE_PTRMEM_P and TYPE_PTR_TO_MEMBER_P. From the names it is not clear what is the difference. This could be TYPE_PTR_TO_DATA_MEMBER and TYPE_PTR_TO_ANY_MEMBER. The few extra chars help a lot to clarify the meaning. Also tree.h already has POINTER_TYPE_P, what is the difference? There are a few other such accessors where the names seem to match with other accessors from cp-tree.h, but the implementations are a bit different. And both forms are used in cp/. Quite a mess... Cheers, Manuel.