public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] Fortran : Bogus error with additional blanks in type(*) PR95829
Date: Thu, 17 Sep 2020 17:09:16 +0000 (GMT)	[thread overview]
Message-ID: <20200917170916.DDED0398793D@sourceware.org> (raw)

https://gcc.gnu.org/g:4140db5cc43b0668c187103406a7586eed4a8dc4

commit 4140db5cc43b0668c187103406a7586eed4a8dc4
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Tue Jun 23 11:01:28 2020 +0100

    Fortran  : Bogus error with additional blanks in type(*) PR95829
    
    Checking for "* ) " instead of "*)" clears the bogus error.
    
    2020-07-01  Steven G. Kargl  <kargl@gcc.gnu.org>
    
    gcc/fortran/
    
            PR fortran/95829
            * decl.c (gfc_match_decl_type_spec): Compare with "* ) " instead
            of "*)".
    
    2020-07-01  Mark Eggleston  <markeggleston@gcc.gnu.org>
    
    gcc/testsuite/
    
            PR fortran/95829
            * gfortran.dg/pr95829.f90: New test.
    
    (cherry picked from commit 624e60f080989fa57756575a0bb47a97748b52b8)

Diff:
---
 gcc/fortran/decl.c                    |  2 +-
 gcc/testsuite/gfortran.dg/pr95829.f90 | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 8e7327dc568..3d04e65015d 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3928,7 +3928,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
       gfc_gobble_whitespace ();
       if (gfc_peek_ascii_char () == '*')
 	{
-	  if ((m = gfc_match ("*)")) != MATCH_YES)
+	  if ((m = gfc_match ("* ) ")) != MATCH_YES)
 	    return m;
 	  if (gfc_comp_struct (gfc_current_state ()))
 	    {
diff --git a/gcc/testsuite/gfortran.dg/pr95829.f90 b/gcc/testsuite/gfortran.dg/pr95829.f90
new file mode 100644
index 00000000000..081d647c7c0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95829.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Declaration of b used to be a bogus failure.
+
+subroutine s (a, b, c, d, e, f, g)
+  type(*) :: a
+  type(* ) :: b
+  type( *) :: c
+  type( * ) :: d
+  type(*  ) :: e
+  type(  *) :: f
+  type(  *  ) :: g
+end
+


                 reply	other threads:[~2020-09-17 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200917170916.DDED0398793D@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@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).