aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2007-09-24 23:15:00 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2007-09-24 23:15:00 +0200
commit86e9d05f3541b1142799a2772dab463bc696221c (patch)
tree6fd80c148ea321cfd2bc3f25ffe2aa5985e2ff64 /gcc/fortran/io.c
parentc028b28617a47266de561005bd3680ad03f9b6e9 (diff)
downloadgcc-86e9d05f3541b1142799a2772dab463bc696221c.zip
gcc-86e9d05f3541b1142799a2772dab463bc696221c.tar.gz
gcc-86e9d05f3541b1142799a2772dab463bc696221c.tar.bz2
re PR fortran/33269 (Diagnose missing "(" in "PRINT ('a'),")
PR fortran/33269 fortran/ * io.c (check_format_string): Move NULL and constant checks into this function. (check_io_constraints): Call gfc_simplify_expr() before calling check_format_string(). Remove NULL and constant checks. testsuite/ * gfortran.dg/fmt_error_2.f90: New. From-SVN: r128732
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 901af92..0e2a0cb 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -919,6 +919,9 @@ finished:
static try
check_format_string (gfc_expr *e, bool is_input)
{
+ if (!e || e->expr_type != EXPR_CONSTANT)
+ return SUCCESS;
+
mode = MODE_STRING;
format_string = e->value.character.string;
return check_format (is_input);
@@ -2786,8 +2789,8 @@ if (condition) \
}
expr = dt->format_expr;
- if (expr != NULL && expr->expr_type == EXPR_CONSTANT
- && check_format_string (expr, k == M_READ) == FAILURE)
+ if (gfc_simplify_expr (expr, 0) == FAILURE
+ || check_format_string (expr, k == M_READ) == FAILURE)
return MATCH_ERROR;
return m;