This is the mail archive of the gcc-bugs@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]

[Bug fortran/51815] New: confusing substring syntax with array section for character coarray


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51815

             Bug #: 51815
           Summary: confusing substring syntax with array section for
                    character coarray
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: longb@cray.com


For this test:

> cat test.f90
PROGRAM caf_test_P0201R
   implicit none
   character(10) :: s[*]
   character(18) :: d = 'ABCDEFGHIJKLMNOPQR'
   integer       :: img

   img = this_image()
   s = d(img:img+9)
   print *, img, s
   print *, img, s(2:4)
END PROGRAM

> gfortran -fcoarray=single test.f90
test.f90:10.18:

   print *, img, s(2:4)
                  1
Error: Rank mismatch in array reference at (1) (1/0)

The character variable s is not an array. The compiler appears to be confusing
the substring syntax with an array section. 

Subclause 6.4.1 [118:9-15] indicates that this is allowed syntax. (coindexed
<parent-string>)


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