Why is the TREE_PURPOSE of a CONSTRUCTOR_ELT list for ARRAY_TYPE NULL?
Daniel Berlin
dberlin@dberlin.org
Mon Sep 6 19:55:00 GMT 2004
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 :)
More information about the Gcc
mailing list