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] | |
You are not testing for conformance - just equal ranks. Why don't you use gfc_check_conformance (const char*, gfc_expr *, gfc_expr*), which will check the shapes as well? The standard does actually specify conformability.
+ if (m != NULL && m->rank != 0 && m->rank != a->rank) + { + gfc_error ("'%s' argument of '%s' intrinsic at %L must be conformable " + "with '%s' argument", gfc_current_intrinsic_arg[0], + gfc_current_intrinsic, &a->where, + gfc_current_intrinsic_arg[2]); + return FAILURE; + + } return SUCCESS; }
! { dg-do compile }Ditto.
! PR 26039: Tests for different ranks for (min|max)loc, (min|max)val, product
! and sum were missing.
program main
integer, dimension(2) :: a
logical, dimension(2,1) :: lo
a = (/ 1, 2 /)
lo = .true.
print *,minloc(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,maxloc(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,minval(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,maxval(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,sum(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,product(a,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,minloc(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,maxloc(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,minval(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,maxval(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,sum(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
print *,product(a,1,mask=lo) ! { dg-error "must be conformable with 'mask' argument" }
end program main
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |