re PR fortran/90297 (gcc/fortran/resolve.c: 2 * possibly redundant code ?)

2019-08-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90297
	* match.c (gfc_match_equivalence): Check that EQUIVALENCE is followed
	by '('.

2019-08-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/90297
	* gfortran.dg/equiv_10.f90: New test.

From-SVN: r274031
This commit is contained in:
Steven G. Kargl 2019-08-02 21:28:58 +00:00
parent 5440f245c8
commit e6938b986e
4 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90297
* match.c (gfc_match_equivalence): Check that EQUIVALENCE is followed
by '('.
2019-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91296

View File

@ -5552,6 +5552,15 @@ gfc_match_equivalence (void)
gfc_common_head *common_head = NULL;
bool common_flag;
int cnt;
char c;
/* EQUIVALENCE has been matched. After gobbling any possible whitespace,
the next character needs to be '('. Check that here, and return
MATCH_NO for a variable of the form equivalencej. */
gfc_gobble_whitespace ();
c = gfc_peek_ascii_char ();
if (c != '(')
return MATCH_NO;
tail = NULL;

View File

@ -1,3 +1,8 @@
2019-08-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90297
* gfortran.dg/equiv_10.f90: New test.
2019-08-02 Marek Polacek <polacek@redhat.com>
PR c++/56428

View File

@ -0,0 +1,15 @@
! { dg-do compile }
! PR fortran/90986
module mymod
type :: mytyp
integer :: i
end type mytyp
contains
subroutine mysub
implicit none
type(mytyp) :: a
integer :: equivalencei,equivalencej
equivalencei = a%i
equivalencej = a%j ! { dg-error "is not a member of the" }
end subroutine mysub
end module mymod