This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about a constant array reference in the C++ front end
Kazu,
> Then how do I know that an array is declared with const (or static
> const)? When I looked at the CONSTRUCTOR stored in the DECL_INITIAL
> of an array, I saw it with the TREE_STATIC flag set regardless of
> whether the array is declared with const, so that's not useful to
> determine whether the array is declared with const.
cp_type_quals (type) & CP_QUAL_CONST
> Do you know how to trigger a RANGE_EXPR? I see that in
> build_zero_init, so I tried a big array with only zeros in it, but
> that didn't help.
I can't recall exactly. It might be for default initialization.
Something like
ptr = new int[100] ();
look at build_zero_init in cp/init.c
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk