aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-const.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-11-22 01:59:16 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-11-22 01:59:16 +0000
commit9d3d3f10787f32a48a5a9faf496d40ad6f5a21cf (patch)
tree0d4d74372861eb96025df3489eb0ad51d38a7c91 /gcc/fortran/trans-const.c
parentfd829514a535410961aef304434de9f7488a4e56 (diff)
downloadgcc-9d3d3f10787f32a48a5a9faf496d40ad6f5a21cf.zip
gcc-9d3d3f10787f32a48a5a9faf496d40ad6f5a21cf.tar.gz
gcc-9d3d3f10787f32a48a5a9faf496d40ad6f5a21cf.tar.bz2
trans-const.c (gfc_conv_const): Fix typo in comment.
2009-11-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> * trans-const.c (gfc_conv_const): Fix typo in comment. Replace assert with error message if not constant. * resolve.c (next_data_value): Delete check for constant. From-SVN: r154418
Diffstat (limited to 'gcc/fortran/trans-const.c')
-rw-r--r--gcc/fortran/trans-const.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 035f40b..e2cd40b 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -340,7 +340,7 @@ void
gfc_conv_constant (gfc_se * se, gfc_expr * expr)
{
/* We may be receiving an expression for C_NULL_PTR or C_NULL_FUNPTR. If
- so, they expr_type will not yet be an EXPR_CONSTANT. We need to make
+ so, the expr_type will not yet be an EXPR_CONSTANT. We need to make
it so here. */
if (expr->ts.type == BT_DERIVED && expr->ts.u.derived
&& expr->ts.u.derived->attr.is_iso_c)
@@ -353,7 +353,11 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
}
}
- gcc_assert (expr->expr_type == EXPR_CONSTANT);
+ if (expr->expr_type != EXPR_CONSTANT)
+ {
+ gfc_error ("non-constant initialization expression at %L", &expr->where);
+ return;
+ }
if (se->ss != NULL)
{