This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPENULL?


The documentation claims:

   For ARRAY_TYPE:
   The TREE_PURPOSE of each node is the corresponding index.
   If the TREE_PURPOSE is a RANGE_EXPR, it is a short-hand for many
nodes,
   one for each index in the range.  (If the corresponding TREE_VALUE
   has side-effects, they are evaluated once for each element.  Wrap the
   value in a SAVE_EXPR if you want to evaluate side effects only once.)

Nothing in there says it could be NULL.

Except in the constructors i'm dealing with (C++ vtables, represented as
arrays), all the TREE_PURPOSES in the constructor list are NULL.
Does that mean that the corresponding index is the last index + 1?

In any case, is this a documentation bug, or a C++ FE bug (IE should i
expect tree_purpose to always be there, and it's just not getting set in
the case of the C vtables, or do the docs need updating)?

I'm trying to figure out whether i need to submit a patch to the
documentation, or the C++ FE :)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]