+2009-07-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/40727
+ * fortran/check.c (gfc_check_cmplx, gfc_check_dcmplx): Add check that
+ the optional second argument isn't of COMPLEX type.
+
2009-07-17 Richard Guenther <rguenther@suse.de>
PR c/40401
gfc_current_intrinsic, &y->where);
return FAILURE;
}
+
+ if (y->ts.type == BT_COMPLEX)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must have a type "
+ "of either REAL or INTEGER", gfc_current_intrinsic_arg[1],
+ gfc_current_intrinsic, &y->where);
+ return FAILURE;
+ }
+
}
if (kind_check (kind, 2, BT_COMPLEX) == FAILURE)
gfc_current_intrinsic, &y->where);
return FAILURE;
}
+
+ if (y->ts.type == BT_COMPLEX)
+ {
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must have a type "
+ "of either REAL or INTEGER", gfc_current_intrinsic_arg[1],
+ gfc_current_intrinsic, &y->where);
+ return FAILURE;
+ }
}
return SUCCESS;
+2009-07-18 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/40727
+ * gfortran.dg/intrinsic_cmplx.f90: New test.
+
2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670
--- /dev/null
+! { dg-do compile }
+! PR fortran/40727
+program test
+ integer, parameter :: sp = kind(1.e0), dp = kind(1.d0)
+ complex(sp) :: s
+ complex(dp) :: d
+ s = cmplx(0.e0, cmplx(0.e0,0.e0)) ! { dg-error "either REAL or INTEGER" }
+ d = dcmplx(0.d0, cmplx(0.d0,0.d0)) ! { dg-error "either REAL or INTEGER" }
+end program test