This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [patch, fortran] PR36355: fix argument type checking for matmul


Daniel Franke wrote:
The diagnosed error is correct, but gives the wrong argument name as
the culprit (see PR for an example). The fix is quite obvious, I will
commit it in 24 h ours if there are no objections.
OBJECTION. I think the current/old logic is OK with regards of rejecting and accepting arguments; I agree that the message might be misleading.

There are the following cases and you only regarded (a) and (b), but not (c) and (d):

a) a=[logical/numeric], b = invalid(e.g. character)
b) a = invalid(e.g. character), b=[logical/numeric]
c) a=logical, b = numerical
d) a=numerical, b = logical.

Test program, which should be rejected:

 integer :: a(4,4)
 logical :: b(4,4)
 print *, matmul(a,b)
 end

With your patch it is accepted, but a "Warning: Extension: Conversion from INTEGER(4) to LOGICAL(4)" is printed. Note that even the very generous ifort rejects that program.

Tobias


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