diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-02 23:48:36 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-02 23:48:36 +0000 |
commit | 623c32bc78dfc7700dfd00adaaf0307b88787f72 (patch) | |
tree | 8a3a745d82229705d41d97496f061e6eb1def245 | |
parent | 5cd3301ba8470be1408f34bdda0ab96cc7f625d9 (diff) | |
download | gcc-623c32bc78dfc7700dfd00adaaf0307b88787f72.zip gcc-623c32bc78dfc7700dfd00adaaf0307b88787f72.tar.gz gcc-623c32bc78dfc7700dfd00adaaf0307b88787f72.tar.bz2 |
re PR fortran/90985 (Wrong error message with variables named "DATA*")
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90985
* decl.c (gfc_match_data): In free-form code, DATA be followed by
whitespace.
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90985
* gfortran.dg/pr90985.f90: New test.
From-SVN: r274033
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr90985.f90 | 14 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a23a6e0..3eb02c2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> + PR fortran/90985 + * decl.c (gfc_match_data): In free-form code, DATA be followed by + whitespace. + +2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> + PR fortran/90986 * match.c (gfc_match_equivalence): Check that EQUIVALENCE is followed by '('. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a7886b0..1415b97 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -621,6 +621,13 @@ gfc_match_data (void) gfc_expr *e; gfc_ref *ref; match m; + char c; + + /* DATA has been matched. In free form source code, the next character + needs to be whitespace. Check that here. */ + c = gfc_peek_ascii_char (); + if (gfc_current_form == FORM_FREE && !gfc_is_whitespace (c)) + return MATCH_NO; /* Before parsing the rest of a DATA statement, check F2008:c1206. */ if ((gfc_current_state () == COMP_FUNCTION diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af4769f..8f58e18 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> + PR fortran/90985 + * gfortran.dg/pr90985.f90: New test. + +2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> + PR fortran/90986 * gfortran.dg/equiv_10.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/pr90985.f90 b/gcc/testsuite/gfortran.dg/pr90985.f90 new file mode 100644 index 0000000..48f5023 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr90985.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +module mymod + type :: mytyp + integer :: i + end type mytyp +contains + subroutine mysub + implicit none + type(mytyp) :: a + integer :: datai,dataj + datai = a%i + dataj = a%j ! { dg-error "is not a member of the" } + end subroutine mysub +end module mymod |