This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51815] New: confusing substring syntax with array section for character coarray
- From: "longb at cray dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2012 19:32:34 +0000
- Subject: [Bug fortran/51815] New: confusing substring syntax with array section for character coarray
- Auto-submitted: auto-generated
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>)