Expected: An error that the user operator .sub. does not exist. Actually: Compiles. NAG f95: Error: foo.f90, line 9: Cannot find symbol .SUB. in module A module a implicit none contains subroutine sub() end subroutine sub end module a program test use a, only: operator(.sub.) end program test
Extended example (rejects-valid + accepts-invalid): (Overlaps partially with PR31298) module a implicit none interface operator(.op.) module procedure sub end interface contains function sub(i) integer :: sub integer,intent(in) :: i sub = -i end function sub end module a program test ! works, but shouldn't use a, only: operator(.sub.), operator(.my.) => operator(.sub.) ! ! Does not work, but should: !use a, only: operator(.op.), operator(.my.) => operator(.op.) !Error: Symbol 'op' referenced at (1) not found in module 'a' end program test
Subject: Bug number PR33072 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01039.html
Subject: Bug 33072 Author: burnus Date: Thu Aug 16 18:17:46 2007 New Revision: 127564 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127564 Log: 2007-08-16 Tobias Burnus <burnus@net-b.de> PR fortran/33072 * module.c (gfc_match_use): Mark user operators as such. (find_use_name_n): Distinguish between operators and other symbols. (find_use_name,number_use_names,mio_namelist, load_operator_interfaces,load_generic_interfaces,read_module, write_generic): Update find_use_name_n calls. 2007-08-16 Tobias Burnus <burnus@net-b.de> PR fortran/33072 * gfortran.dg/use_9.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/use_9.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/testsuite/ChangeLog
FIXED - but only the initially reported bug. The other I push back to PR31298.