mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 15:01:17 +08:00
re PR fortran/56007 (Remarkably bad error message with DO array=1,2)
2016-02-28 Harald Anlauf <anlauf@gmx.de> Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/56007 * match.c (gfc_match_iterator): Add diagnostic for array variable as do loop index. * gfortran.dg/coarray_8.f90: Adjust error message. * gfortran.dg/pr56007.f90: New test. * gfortran.dg/pr56007.f: New test. Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org> From-SVN: r233795
This commit is contained in:
parent
cdc1a2c805
commit
b2fd537394
@ -1,3 +1,10 @@
|
||||
2016-02-28 Harald Anlauf <anlauf@gmx.de>
|
||||
Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR fortran/56007
|
||||
* match.c (gfc_match_iterator): Add diagnostic for array variable
|
||||
as do loop index.
|
||||
|
||||
2016-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
|
@ -877,6 +877,12 @@ gfc_match_iterator (gfc_iterator *iter, int init_flag)
|
||||
if (m != MATCH_YES)
|
||||
return MATCH_NO;
|
||||
|
||||
if (var->symtree->n.sym->attr.dimension)
|
||||
{
|
||||
gfc_error ("Loop variable at %C cannot be an array");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* F2008, C617 & C565. */
|
||||
if (var->symtree->n.sym->attr.codimension)
|
||||
{
|
||||
|
@ -1,3 +1,11 @@
|
||||
2016-02-28 Harald Anlauf <anlauf@gmx.de>
|
||||
Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR fortran/56007
|
||||
* gfortran.dg/coarray_8.f90: Adjust error message.
|
||||
* gfortran.dg/pr56007.f90: New test.
|
||||
* gfortran.dg/pr56007.f: New test.
|
||||
|
||||
2016-02-28 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR tree-optimization/69989
|
||||
|
@ -146,7 +146,7 @@ end module mmm4
|
||||
subroutine tfgh()
|
||||
integer :: i(2)
|
||||
DATA i/(i, i=1,2)/ ! { dg-error "Expected PARAMETER symbol" }
|
||||
do i = 1, 5 ! { dg-error "cannot be a sub-component" }
|
||||
do i = 1, 5 ! { dg-error "cannot be an array" }
|
||||
end do ! { dg-error "Expecting END SUBROUTINE" }
|
||||
end subroutine tfgh
|
||||
|
||||
|
10
gcc/testsuite/gfortran.dg/pr56007.f
Normal file
10
gcc/testsuite/gfortran.dg/pr56007.f
Normal file
@ -0,0 +1,10 @@
|
||||
! { dg-do compile }
|
||||
! PR fortran/56007
|
||||
! Based on testcase by Tobias Schlüter
|
||||
|
||||
integer iw1(90), doiw1(90)
|
||||
do iw1(1)=1
|
||||
do iw1=1
|
||||
do iw1=1,2 ! { dg-error "cannot be an array" }
|
||||
end do ! { dg-error "Expecting END PROGRAM statement" }
|
||||
END
|
11
gcc/testsuite/gfortran.dg/pr56007.f90
Normal file
11
gcc/testsuite/gfortran.dg/pr56007.f90
Normal file
@ -0,0 +1,11 @@
|
||||
! { dg-do compile }
|
||||
! PR fortran/56007
|
||||
! Based on testcase by Tobias Schlüter
|
||||
|
||||
integer iw1(90), doiw1(90)
|
||||
do iw1=1,2 ! { dg-error "cannot be an array" }
|
||||
end do ! { dg-error "Expecting END PROGRAM statement" }
|
||||
do iw1(1)=1 ! { dg-error "Unclassifiable statement" }
|
||||
do iw1=1 ! { dg-error "cannot be an array" }
|
||||
end do ! { dg-error "Expecting END PROGRAM statement" }
|
||||
END program
|
Loading…
x
Reference in New Issue
Block a user