This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/31298] [F03] use mod, operator(+) => operator(.userOp.) not supported


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31298

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #19 from janus at gcc dot gnu.org ---
(In reply to Jürgen Reuter from comment #18)
> Contrary to what Tobias Burnus claimed, I think this case is indeed
> forbidden.

I agree with Jürgen's assessment in comment #18 that use-renaming of operators
may not involve any intrinsic operators, which is also supported by ifort 18
and MR&C (as noted by Tobias in comment #13).


Here is a simple test case that is accepted by ifort and gfortran as is (and
rejected by both when uncommenting the commented line):


module m

  interface operator(.myplus.)
    procedure add
  end interface

contains

  integer function add(a, b)
    integer, intent(in) :: a,b
    add = abs(a) + abs(b)
  end function

end module


program p
! use m, only: operator(+) => operator(.myplus.)  ! forbidden
use m, only: operator(.otherplus.) => operator(.myplus.)
print *, -1 .otherplus. -2
end



So: Let's finally close this PR ...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]