+2006-06-22 Asher Langton <langton2@llnl.gov>
+
+ PR fortran/24748
+ * primary.c (gfc_match_rvalue): Don't call match_substring for
+ implicit non-character types.
+
2006-06-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/26769
gfc_expr *e;
match m, m2;
int i;
+ gfc_typespec *ts;
+ bool implicit_char;
m = gfc_match_name (name);
if (m != MATCH_YES)
if (m2 != MATCH_YES)
{
+ /* Try to figure out whether we're dealing with a character type.
+ We're peeking ahead here, because we don't want to call
+ match_substring if we're dealing with an implicitly typed
+ non-character variable. */
+ implicit_char = false;
+ if (sym->ts.type == BT_UNKNOWN)
+ {
+ ts = gfc_get_default_type (sym,NULL);
+ if (ts->type == BT_CHARACTER)
+ implicit_char = true;
+ }
+
/* See if this could possibly be a substring reference of a name
that we're not sure is a variable yet. */
- if ((sym->ts.type == BT_UNKNOWN || sym->ts.type == BT_CHARACTER)
+ if ((implicit_char || sym->ts.type == BT_CHARACTER)
&& match_substring (sym->ts.cl, 0, &e->ref) == MATCH_YES)
{
+2006-06-22 Asher Langton <langton2@llnl.gov>
+
+ PR fortran/24748
+ * gfortran.dg/implicit_8.f90: New.
+
2006-06-22 Zdenek Dvorak <dvorakz@suse.cz>
PR rtl-optimization/28121
--- /dev/null
+! { dg-do compile }
+! PR 24748
+
+! The compiler used to crash trying to take a substring of an implicit
+! real scalar.
+subroutine variant1
+ ybtable=ylocal(1:2) ! { dg-error "Syntax error in argument list" }
+end
+
+! We want the behavior to be the same whether ylocal is implicitly
+! or explicitly typed.
+subroutine variant2
+ real ylocal
+ ybtable=ylocal(1:2) ! { dg-error "Syntax error in argument list" }
+end
+