public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/31259] ICE on elemental character function
Date: Tue, 24 Jul 2007 13:28:00 -0000	[thread overview]
Message-ID: <20070724132845.24058.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31259-10259@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2007-07-24 13:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  0:58 [Bug fortran/31259] New: " fxcoudert at gcc dot gnu dot org
2007-03-29 10:44 ` [Bug fortran/31259] " pault at gcc dot gnu dot org
2007-07-17 10:38 ` dfranke at gcc dot gnu dot org
2007-07-24 13:28 ` burnus at gcc dot gnu dot org [this message]
2007-10-19 23:21 ` jvdelisle at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070724132845.24058.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).