Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

uses now the right expression in error message; also g95_is_constant_…

…expr can deal now with EXPR_FUNCTION
  • Loading branch information...
commit 6d1b1344a95ede95db401e55a61314a8a3fe5399 1 parent 8965ac2
arnaud02 authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 intrinsic.c
View
12 intrinsic.c
@@ -2173,7 +2173,7 @@ char *name;
try g95_convert_type(g95_expr *expr, g95_typespec *ts, int eflag) {
g95_intrinsic_sym *sym;
locus old_where;
-g95_expr *new;
+g95_expr *new, *reale;
int rank;
if (ts->type == BT_UNKNOWN) goto bad;
@@ -2209,7 +2209,7 @@ int rank;
g95_free(new);
expr->ts = *ts;
- if (g95_is_constant_expr(expr->value.function.actual->expr) &&
+ if (g95_is_constant_expr(expr) &&
do_simplify(sym, expr) == FAILURE) {
if (eflag == 2) goto bad;
@@ -2219,14 +2219,18 @@ int rank;
return SUCCESS;
bad:
+ reale = expr;
+ if (expr->expr_type == EXPR_FUNCTION)
+ reale = expr->value.function.actual->expr;
if (eflag == 1) {
g95_error("Can't convert %s to %s at %L",
- g95_typename(&expr->ts), g95_typename(ts), &expr->where);
+ g95_typename(&reale->ts), g95_typename(ts), &reale->where);
return FAILURE;
}
g95_internal_error("Can't convert %s to %s at %L",
- g95_typename(&expr->ts), g95_typename(ts), &expr->where);
+ g95_typename(&reale->ts), g95_typename(ts),
+ &reale->where);
return FAILURE;
}
Please sign in to comment.
Something went wrong with that request. Please try again.