This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31259] ICE on elemental character function
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2007 13:28:45 -0000
- Subject: [Bug fortran/31259] ICE on elemental character function
- References: <bug-31259-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from burnus at gcc dot gnu dot org 2007-07-24 13:28 -------
The following patch works for the original example; it also works in principle
for the additional example, but there the error message is printed three times.
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 126873)
+++ gcc/fortran/expr.c (working copy)
@@ -2397,6 +2397,15 @@
break;
}
+ if (sym->attr.dummy && sym->ns->proc_name != NULL
+ && sym->ns->proc_name->attr.elemental)
+ {
+ gfc_error ("Dummy argument '%s' of elemental function '%s' "
+ "cannot appear in a specification expression at %L",
+ sym->name, sym->ns->proc_name->name, &e->where);
+ break;
+ }
+
/* gfc_is_formal_arg broadcasts that a formal argument list is being
processed in resolve.c(resolve_formal_arglist). This is done so
that host associated dummy array indices are accepted (PR23446).
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 126873)
+++ gcc/fortran/resolve.c (working copy)
@@ -3771,7 +3779,7 @@
if (!seen)
{
if (specification_expr)
- gfc_error ("Variable '%s',used in a specification expression, "
+ gfc_error ("Variable '%s', used in a specification expression,
"
"is referenced at %L before the ENTRY statement "
"in which it is a parameter",
sym->name, &cs_base->current->loc);
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31259