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.
This commit is contained in:
Mark Eggleston 2020-06-23 11:01:28 +01:00
parent 2f3fd53220
commit 624e60f080
2 changed files with 15 additions and 1 deletions

View File

@ -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 ()))
{

View File

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