Re: [Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-02 Thread Harald Anlauf
Hi Andre, Am 02.10.24 um 10:49 schrieb Andre Vehreschild: Hi Harald, we could do something like this: diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index d73d5eaed84..5000906f5f2 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2823,6 +2823,16 @@ check_substr

Re: [Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-02 Thread Andre Vehreschild
Hi Harald, we could do something like this: diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index d73d5eaed84..5000906f5f2 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2823,6 +2823,16 @@ check_substring: if (substring) primary->ts.u.cl =

Re: [Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-01 Thread Harald Anlauf
Hi Andre, Am 01.10.24 um 09:43 schrieb Andre Vehreschild: Hi all, this rather old PR reported a parsing bug, when a coarray'ed character substring ref is to be parsed, aka CHARACTER(:) :: str[:] ... str(2:5). In this case the parser confused the substring ref with an array-ref, because an array

[Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-01 Thread Andre Vehreschild
Hi all, this rather old PR reported a parsing bug, when a coarray'ed character substring ref is to be parsed, aka CHARACTER(:) :: str[:] ... str(2:5). In this case the parser confused the substring ref with an array-ref, because an array_spec was present. This patch fixes this by requesting only c