This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31298] [F03] use mod, operator(+) => operator(.userOp.) not supported
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Apr 2018 19:01:14 +0000
- Subject: [Bug fortran/31298] [F03] use mod, operator(+) => operator(.userOp.) not supported
- Auto-submitted: auto-generated
- References: <bug-31298-4@http.gcc.gnu.org/bugzilla/>
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 ...