re PR fortran/91485 (Erroneous conflict between variable x and operator(.x.))

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

	PR fortran/91485
	module.c (gfc_match_use): User defined operator cannot conflict with
	a rename symbol.

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

	PR fortran/91485
	* gfortran.dg/pr91485.f90: New test.

From-SVN: r274630
This commit is contained in:
Steven G. Kargl 2019-08-19 03:00:54 +00:00
parent e00f86581f
commit 88898d1e1e
4 changed files with 36 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-08-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91485
module.c (gfc_match_use): User defined operator cannot conflict with
a rename symbol.
2019-08-17 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82992

View File

@ -647,7 +647,7 @@ gfc_match_use (void)
new_use->op = INTRINSIC_USER;
st = gfc_find_symtree (gfc_current_ns->sym_root, name);
if (st)
if (st && type != INTERFACE_USER_OP)
{
if (m == MATCH_YES)
gfc_error ("Symbol %qs at %L conflicts with the rename symbol "

View File

@ -1,3 +1,8 @@
2019-08-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91485
* gfortran.dg/pr91485.f90: New test.
2019-08-17 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82992

View File

@ -0,0 +1,24 @@
! { dg-do compile }
module foo
implicit none
interface operator(.x.)
module procedure product
end interface operator(.x.)
contains
function product(x, y)
real, intent(in) :: x, y
real :: product
product = x * y
end function product
end module foo
module gfcbug155
implicit none
contains
subroutine print_prod (x, y)
use foo, only : operator(.x.)
implicit none
real :: x, y
print *, x .x. y
end subroutine print_prod
end module gfcbug155