[Bug fortran/36355] New: matmul argument-check: wrong error messages
dfranke at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed May 28 09:47:00 GMT 2008
$> cat matmul.f90
REAL, DIMENSION(2,2) :: a
character(1) :: b
print *, MATMUL(a, b) ! line 4: argument matrix_b is wrong
print *, MATMUL(b, a) ! line 5: argument matrix_a is wrong
end
$> gfortran-svn matmul.f90
matmul.f90:4.18:
print *, MATMUL(a, b)
1
Error: 'matrix_a' argument of 'matmul' intrinsic at (1) must be numeric or
LOGICAL
matmul.f90:5.20:
print *, MATMUL(b, a)
1
Error: 'matrix_b' argument of 'matmul' intrinsic at (1) must be numeric or
LOGICAL
Proposed change (untested):
Index: check.c
===================================================================
--- check.c (revision 136058)
+++ check.c (working copy)
@@ -1761,7 +1761,7 @@ gfc_check_malloc (gfc_expr *size)
try
gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
{
- if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
+ if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
"or LOGICAL", gfc_current_intrinsic_arg[0],
@@ -1769,7 +1769,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gf
return FAILURE;
}
- if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
+ if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
{
gfc_error ("'%s' argument of '%s' intrinsic at %L must be numeric "
"or LOGICAL", gfc_current_intrinsic_arg[1],
--
Summary: matmul argument-check: wrong error messages
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dfranke at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36355
More information about the Gcc-bugs
mailing list