gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
rc = ARITH_OK;
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
gfc_expr *result;
arith rc;
+ if (!gfc_numeric_ts (&op1->ts) || !gfc_numeric_ts (&op2->ts))
+ return ARITH_INVALID_TYPE;
+
rc = ARITH_OK;
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
--- /dev/null
+! { dg-do compile }
+! PR fortran/107217 - ICE in gfc_arith_times
+! Contributed by G.Steinmetz
+
+program p
+ print *, [real :: (['1'])] * 2 ! { dg-error "Cannot convert" }
+ print *, 2 * [real :: (['1'])] ! { dg-error "Cannot convert" }
+ print *, [real :: (['1'])] + 2 ! { dg-error "Cannot convert" }
+ print *, [real :: (['1'])] - 2 ! { dg-error "Cannot convert" }
+ print *, [real :: (['1'])] / 2 ! { dg-error "Cannot convert" }
+ print *, 1 / [real :: (['1'])] ! { dg-error "Cannot convert" }
+ print *, [real :: (['1'])] ** 2 ! { dg-error "Cannot convert" }
+ print *, 2 ** [real :: (['1'])] ! { dg-error "Cannot convert" }
+ print *, 2.0 ** [real :: (.true.)] ! { dg-error "Cannot convert" }
+ print *, [real :: (.true.)] ** 2.0 ! { dg-error "Cannot convert" }
+ print *, [complex :: (['1'])] ** (1.0,2.0) ! { dg-error "Cannot convert" }
+ print *, (1.0,2.0) ** [complex :: (['1'])] ! { dg-error "Cannot convert" }
+end