public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/97122] Spurious FINAL ... must be in the specification part of a MODULE
Date: Sun, 20 Sep 2020 03:26:06 +0000	[thread overview]
Message-ID: <bug-97122-4-UPP5sZfnn0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97122-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97122

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-09-20
     Ever confirmed|0                           |1
                 CC|                            |kargl at gcc dot gnu.org
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from kargl at gcc dot gnu.org ---
This allows your code to compile.

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 280157)
+++ gcc/fortran/decl.c  (working copy)
@@ -11395,8 +11395,9 @@ gfc_match_final_decl (void)
   block = gfc_state_stack->previous->sym;
   gcc_assert (block);

-  if (!gfc_state_stack->previous || !gfc_state_stack->previous->previous
-      || gfc_state_stack->previous->previous->state != COMP_MODULE)
+  if (!gfc_state_stack->previous->previous
+      && gfc_state_stack->previous->previous->state != COMP_MODULE
+      && gfc_state_stack->previous->previous->state != COMP_SUBMODULE)
     {
       gfc_error ("Derived type declaration with FINAL at %C must be in the"
                 " specification part of a MODULE");

Alternatively, the if-block can likely be removed.

  reply	other threads:[~2020-09-20  3:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20  0:21 [Bug fortran/97122] New: " ian_harvey at bigpond dot com
2020-09-20  3:26 ` kargl at gcc dot gnu.org [this message]
2023-05-04  6:13 ` [Bug fortran/97122] " pault at gcc dot gnu.org
2023-05-04  8:07 ` pault at gcc dot gnu.org
2023-05-04 17:45 ` kargl at gcc dot gnu.org
2023-05-04 19:01 ` kargl at gcc dot gnu.org
2023-05-04 22:17 ` ian_harvey at bigpond dot com
2023-05-07 15:59 ` kargl at gcc dot gnu.org
2023-05-07 18:41 ` anlauf at gcc dot gnu.org
2023-05-08  1:16 ` kargl at gcc dot gnu.org
2023-05-08  6:09 ` pault at gcc dot gnu.org
2023-05-23  5:33 ` cvs-commit at gcc dot gnu.org
2023-09-07 19:04 ` anlauf at gcc dot gnu.org
2023-09-09 11:00 ` pault at gcc dot gnu.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=bug-97122-4-UPP5sZfnn0@http.gcc.gnu.org/bugzilla/ \
    --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).