Commit 58864d1c by Louis Krupp Committed by Louis Krupp

[multiple changes]

2015-10-06  Louis Krupp <louis.krupp@zoho.com>
	PR fortran/65766
	* resolve.c (gfc_resolve_substring_charlen): For derived type,
	use typespec of string component when resolving substring length.

2015-10-06  Louis Krupp     <louis.krupp@zoho.com>

	PR fortran/65766
	* gfortran.dg/substr_alloc_string_comp_1.f90: New.

From-SVN: r228551
parent c12df359
2015-10-06 Louis Krupp <louis.krupp@zoho.com>
PR fortran/65766
* resolve.c (gfc_resolve_substring_charlen): For derived type,
use typespec of string component when resolving substring length.
2015-10-04 Mikael Morin <mikael@gcc.gnu.org> 2015-10-04 Mikael Morin <mikael@gcc.gnu.org>
* match.c (gfc_match_common): Remove dead variable old_blank_common. * match.c (gfc_match_common): Remove dead variable old_blank_common.
......
...@@ -4543,10 +4543,15 @@ gfc_resolve_substring_charlen (gfc_expr *e) ...@@ -4543,10 +4543,15 @@ gfc_resolve_substring_charlen (gfc_expr *e)
{ {
gfc_ref *char_ref; gfc_ref *char_ref;
gfc_expr *start, *end; gfc_expr *start, *end;
gfc_typespec *ts = NULL;
for (char_ref = e->ref; char_ref; char_ref = char_ref->next) for (char_ref = e->ref; char_ref; char_ref = char_ref->next)
if (char_ref->type == REF_SUBSTRING) {
break; if (char_ref->type == REF_SUBSTRING)
break;
if (char_ref->type == REF_COMPONENT)
ts = &char_ref->u.c.component->ts;
}
if (!char_ref) if (!char_ref)
return; return;
...@@ -4576,7 +4581,11 @@ gfc_resolve_substring_charlen (gfc_expr *e) ...@@ -4576,7 +4581,11 @@ gfc_resolve_substring_charlen (gfc_expr *e)
if (char_ref->u.ss.end) if (char_ref->u.ss.end)
end = gfc_copy_expr (char_ref->u.ss.end); end = gfc_copy_expr (char_ref->u.ss.end);
else if (e->expr_type == EXPR_VARIABLE) else if (e->expr_type == EXPR_VARIABLE)
end = gfc_copy_expr (e->symtree->n.sym->ts.u.cl->length); {
if (!ts)
ts = &e->symtree->n.sym->ts;
end = gfc_copy_expr (ts->u.cl->length);
}
else else
end = NULL; end = NULL;
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
* gcc.target/aarch64/get_lane_f16_1.c: New test. * gcc.target/aarch64/get_lane_f16_1.c: New test.
2015-10-06 Louis Krupp <louis.krupp@zoho.com>
PR fortran/65766
* gfortran.dg/substr_alloc_string_comp_1.f90: New.
2015-10-06 Marek Polacek <polacek@redhat.com> 2015-10-06 Marek Polacek <polacek@redhat.com>
PR c++/67863 PR c++/67863
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment