diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index f38def4c291..e16b96f6a49 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 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 +