https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91485
Bug ID: 91485
Summary: [10 Regression] Erroneous conflict between variable x
and operator(.x.)
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: anlauf at gcc dot gnu.org
Target Milestone: ---
Created attachment 46725
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46725&action=edit
Minimal reproducer
The attached valid code suddenly fails with current 10-trunk:
gfcbug155.f90:23:26:
23 | subroutine print_prod (x, y)
| 1
24 | use foo, only: cartesian, operator(.x.)
| 2
Error: Symbol 'x' at (1) conflicts with the symbol at (2)
gfcbug155.f90:26:19:
26 | type(cartesian), intent(in) :: x, y
| 1
Error: Derived type 'cartesian' at (1) is being used before it is defined
gfcbug155.f90:23:26:
23 | subroutine print_prod (x, y)
| 1
Error: Symbol 'x' at (1) has no IMPLICIT type
gfcbug155.f90:23:29:
23 | subroutine print_prod (x, y)
| 1
Error: Symbol 'y' at (1) has no IMPLICIT type
The regression is most likely introduced in the last 2 days.
Note that it is important that the USE statement is placed in the contained
subroutine, not at module level.