diff options
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index badd3c4..f22241d 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1350,6 +1350,14 @@ gfc_match_assignment (void) rvalue = NULL; m = gfc_match (" %e%t", &rvalue); + + if (lvalue->expr_type == EXPR_CONSTANT) + { + /* This clobbers %len and %kind. */ + m = MATCH_ERROR; + gfc_error ("Assignment to a constant expression at %C"); + } + if (m != MATCH_YES) { gfc_current_locus = old_loc; |