fortran/
* primary.c (gfc_variable_attr): Don't copy string length if it
doesn't make sense.
* resolve.c (resolve_code): Clarify error message.
testsuite/
* gfortran.dg/char_assign_1.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123759
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org>
+ PR fortran/31266
+ * primary.c (gfc_variable_attr): Don't copy string length if it
+ doesn't make sense.
+ * resolve.c (resolve_code): Clarify error message.
+
PR fortran/31471
* decl.c (gfc_match_end): Also check for construct name in END
FORALL and END WERE statements.
case REF_COMPONENT:
gfc_get_component_attr (&attr, ref->u.c.component);
if (ts != NULL)
- *ts = ref->u.c.component->ts;
+ {
+ *ts = ref->u.c.component->ts;
+ /* Don't set the string length if a substring reference
+ follows. */
+ if (ts->type == BT_CHARACTER
+ && ref->next && ref->next->type == REF_SUBSTRING)
+ ts->cl = NULL;
+ }
pointer = ref->u.c.component->pointer;
allocatable = ref->u.c.component->allocatable;
rlen = mpz_get_si (code->expr2->ts.cl->length->value.integer);
if (rlen && llen && rlen > llen)
- gfc_warning_now ("rhs of CHARACTER assignment at %L will be "
- "truncated (%d/%d)", &code->loc, rlen, llen);
+ gfc_warning_now ("CHARACTER expression will be truncated "
+ "in assignment (%d/%d) at %L",
+ llen, rlen, &code->loc);
}
if (gfc_pure (NULL))
2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org>
+ PR fortran/31266
+ * gfortran.dg/char_assign_1.f90: New.
+
PR fortran/31471
* gfortran.dg/block_name_1.f90: New.
* gfortran.dg/block_name_2.f90: New.