Commit 623c32bc by Steven G. Kargl

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
parent 5cd3301b
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> 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 PR fortran/90986
* match.c (gfc_match_equivalence): Check that EQUIVALENCE is followed * match.c (gfc_match_equivalence): Check that EQUIVALENCE is followed
by '('. by '('.
......
...@@ -621,6 +621,13 @@ gfc_match_data (void) ...@@ -621,6 +621,13 @@ gfc_match_data (void)
gfc_expr *e; gfc_expr *e;
gfc_ref *ref; gfc_ref *ref;
match m; 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. */ /* Before parsing the rest of a DATA statement, check F2008:c1206. */
if ((gfc_current_state () == COMP_FUNCTION if ((gfc_current_state () == COMP_FUNCTION
......
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org> 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 PR fortran/90986
* gfortran.dg/equiv_10.f90: New test. * gfortran.dg/equiv_10.f90: New test.
......
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment