aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Eggleston <markeggleston@gcc.gnu.org>2020-06-23 11:01:28 +0100
committerMark Eggleston <markeggleston@gcc.gnu.org>2020-07-01 10:14:06 +0100
commit624e60f080989fa57756575a0bb47a97748b52b8 (patch)
treed60537fb30ed3744697ca2e0b2e670991ff6b114 /gcc
parent2f3fd53220b74d834d300e0b7aa99eca039ffbea (diff)
downloadgcc-624e60f080989fa57756575a0bb47a97748b52b8.zip
gcc-624e60f080989fa57756575a0bb47a97748b52b8.tar.gz
gcc-624e60f080989fa57756575a0bb47a97748b52b8.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/decl.c2
-rw-r--r--gcc/testsuite/gfortran.dg/pr95829.f9014
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index f38def4..e16b96f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -4128,7 +4128,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 0000000..081d647
--- /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
+