https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97776

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As p is array of pointers, if it was say p[i:2][0:C] it would be
non-contiguous, but in this particular case, while such array sections are
blurry (because
the array section describes the p[i][0], p[i][1] etc. (contiguous) as well as
the p[i] pointer that points to it), I agree it should be probably accepted.

That said, we really need to rewrite the array section handling completely in
the C/C++ FEs, such that rather than having just a special case we just set
some parser flag that array sections are allowed and during parsing of [ ... ]
if that flag is on we also parse the :s in there and create a new
ARRAY_SECTION_REF or similar, and then only later on verify that the array
section is where it can be specified and deal also with the non-contiguous
to/from etc.

Reply via email to