This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Committed] Fix PR fortran/77612
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Sep 2016 10:56:49 -0700
- Subject: [Committed] Fix PR fortran/77612
- Authentication-results: sourceware.org; auth=none
- Reply-to: kargl at uw dot edu
I've committed the following patch.
2016-09-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77612
* decl.c (char_len_param_value): Check parent namespace for
seen_implicit_none.
2016-09-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77612
* gfortran.dg/pr77612.f90: New test.
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 240140)
+++ gcc/fortran/decl.c (working copy)
@@ -920,9 +920,10 @@ char_len_param_value (gfc_expr **expr, b
t = gfc_reduce_init_expr (e);
- if (!t && (e->ts.type == BT_UNKNOWN
- && e->symtree->n.sym->attr.untyped == 1
- && e->symtree->n.sym->ns->seen_implicit_none == 1))
+ if (!t && e->ts.type == BT_UNKNOWN
+ && e->symtree->n.sym->attr.untyped == 1
+ && (e->symtree->n.sym->ns->seen_implicit_none == 1
+ || e->symtree->n.sym->ns->parent->seen_implicit_none == 1))
{
gfc_free_expr (e);
goto syntax;
Index: gcc/testsuite/gfortran.dg/pr77612.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr77612.f90 (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr77612.f90 (working copy)
@@ -0,0 +1,13 @@
+! { dg-do compile }
+
+program bad_len
+
+ implicit none
+
+contains
+
+ subroutine sub
+ character(len = ICE) :: line ! { dg-error "INTEGER expression expected" }
+ end subroutine
+
+end program
--
Steve