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]

Re: Questions about a constant array reference in the C++ front end


Kazu Hirata schrieb:
I am trying to fold array[7] into 2.  It turns out that if T is an
ARRAY_REF,

TREE_READONLY (TREE_OPERAND (T, 0))

is 0. Why?

I don't know anything about fold but in general a c++ array in the frontend is cv-qualified, not its elements.


Another question.  How is a RANGE_EXPR used in a C++'s array
constructor?  The CONSTRUCTOR section of tree.def says

I created an array with more than one thousand elements.  I still did
not see a RANGE_EXPR in the array's CONSTRUCTOR.  How do I get a
RANGE_EXPR in a CONSTRUCTOR?


I have been processing large source codes including STL, boost and custom code including function bodies and I have never seen a RANGE_EXPR. I suppose it's only used at later stages or only in other language's frontends.



Regards,


--
Stefan Strasser


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